Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def answer_question(question):
|
7 |
context = open("data.txt", encoding="utf-8").read()
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
3 |
|
4 |
+
# Модель мен токенизаторды нақты локал жолмен жүктейміз
|
5 |
+
model = AutoModelForQuestionAnswering.from_pretrained("./model")
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained("./model")
|
7 |
+
|
8 |
+
qa_pipeline = pipeline("question-answering", model=model, tokenizer=tokenizer)
|
9 |
|
10 |
def answer_question(question):
|
11 |
context = open("data.txt", encoding="utf-8").read()
|