Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
def question_answer(context, question):
|
3 |
-
|
|
|
|
|
|
|
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()
|