kat33 commited on
Commit
3fae970
·
1 Parent(s): 85c036e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,6 +1,11 @@
1
  import gradio as gr
 
 
2
  def question_answer(context, question):
3
- pass # Implement your question-answering model here...
 
 
 
4
 
5
  app=gr.Interface(fn=question_answer, inputs=["text", "text"], outputs=["textbox", "text"])
6
  app.launch()
 
1
  import gradio as gr
2
+ model="TheBloke/Nous-Hermes-13B-GGML"
3
+
4
  def question_answer(context, question):
5
+ generator = pipeline(model=model, device_map="auto")
6
+ text=context + "\n\nQuestion: \"\"\"\n" + question + "\nPlease use markdown formatting for answer. \nAnswer:\n"
7
+ return generator(text)
8
+
9
 
10
  app=gr.Interface(fn=question_answer, inputs=["text", "text"], outputs=["textbox", "text"])
11
  app.launch()