Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -56,9 +56,10 @@ def context_func(message):
|
|
56 |
|
57 |
return most_similar_context
|
58 |
|
59 |
-
def answer_question(question
|
60 |
context = context_func(question)
|
61 |
-
|
|
|
62 |
# Tokenize the inputs
|
63 |
inputs = tokenizer(question, context, return_tensors="pt", max_length=512, truncation=True)
|
64 |
|
@@ -88,7 +89,7 @@ def main():
|
|
88 |
"""
|
89 |
tokenizer = AutoTokenizer.from_pretrained("nlp-group/sindi-bert-final")
|
90 |
model = AutoModelForQuestionAnswering.from_pretrained("nlp-group/sindi-bert-final")
|
91 |
-
iface = gr.Interface(fn=answer_question
|
92 |
inputs=["text"],
|
93 |
outputs=[gr.Textbox(label="Answer")],
|
94 |
title="Women Cancer ChatBot",
|
|
|
56 |
|
57 |
return most_similar_context
|
58 |
|
59 |
+
def answer_question(question):
|
60 |
context = context_func(question)
|
61 |
+
tokenizer = AutoTokenizer.from_pretrained("nlp-group/sindi-bert-final")
|
62 |
+
model = AutoModelForQuestionAnswering.from_pretrained("nlp-group/sindi-bert-final")
|
63 |
# Tokenize the inputs
|
64 |
inputs = tokenizer(question, context, return_tensors="pt", max_length=512, truncation=True)
|
65 |
|
|
|
89 |
"""
|
90 |
tokenizer = AutoTokenizer.from_pretrained("nlp-group/sindi-bert-final")
|
91 |
model = AutoModelForQuestionAnswering.from_pretrained("nlp-group/sindi-bert-final")
|
92 |
+
iface = gr.Interface(fn=answer_question,
|
93 |
inputs=["text"],
|
94 |
outputs=[gr.Textbox(label="Answer")],
|
95 |
title="Women Cancer ChatBot",
|