Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -73,7 +73,7 @@ def answer_question(question):
|
|
73 |
|
74 |
return answer, context
|
75 |
|
76 |
-
|
77 |
""""
|
78 |
Initializes a Women Cancer ChatBot interface using Hugging Face models for question answering.
|
79 |
|
@@ -87,9 +87,9 @@ def answer_question(question):
|
|
87 |
Example:
|
88 |
>>> main()
|
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",
|
@@ -99,7 +99,7 @@ iface = gr.Interface(fn=answer_question,
|
|
99 |
["What are treatments for cervical cancer?"]
|
100 |
])
|
101 |
|
102 |
-
iface.launch(debug = True, share=True)
|
103 |
|
104 |
#if __name__ == "__main__":
|
105 |
#main()
|
|
|
73 |
|
74 |
return answer, context
|
75 |
|
76 |
+
def main():
|
77 |
""""
|
78 |
Initializes a Women Cancer ChatBot interface using Hugging Face models for question answering.
|
79 |
|
|
|
87 |
Example:
|
88 |
>>> main()
|
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",
|
|
|
99 |
["What are treatments for cervical cancer?"]
|
100 |
])
|
101 |
|
102 |
+
return iface.launch(debug = True, share=True)
|
103 |
|
104 |
#if __name__ == "__main__":
|
105 |
#main()
|