Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
|
2 |
from transformers import pipeline
|
|
|
3 |
import gradio as gr
|
4 |
|
5 |
title = 'Ask a Question in Hindi or Tamil'
|
@@ -10,6 +11,9 @@ examples=[["सन १८८६ में किसने बताया कि
|
|
10 |
"""
|
11 |
]]
|
12 |
|
|
|
|
|
|
|
13 |
nlp = pipeline("question-answering", model=model, tokenizer=tokenizer)
|
14 |
|
15 |
def qa(question, context):
|
|
|
1 |
|
2 |
from transformers import pipeline
|
3 |
+
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
|
4 |
import gradio as gr
|
5 |
|
6 |
title = 'Ask a Question in Hindi or Tamil'
|
|
|
11 |
"""
|
12 |
]]
|
13 |
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained("SmartPy/bert-finetuned-squad-chaii")
|
15 |
+
model = AutoModelForQuestionAnswering.from_pretrained("SmartPy/bert-finetuned-squad-chaii")
|
16 |
+
|
17 |
nlp = pipeline("question-answering", model=model, tokenizer=tokenizer)
|
18 |
|
19 |
def qa(question, context):
|