jrocha commited on
Commit
b8fa6a5
·
verified ·
1 Parent(s): 41b3d38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -73,7 +73,7 @@ def answer_question(question):
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,9 +87,9 @@ def main():
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 @@ def main():
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
+ iface.launch(debug = True, share=True)
103
 
104
+ #if __name__ == "__main__":
105
+ #main()