File size: 406 Bytes
c1e6490
3fae970
 
c1e6490
3fae970
 
 
 
c1e6490
85c036e
 
1
2
3
4
5
6
7
8
9
10
11
12
import gradio as gr
model="TheBloke/Nous-Hermes-13B-GGML"

def question_answer(context, question):
    generator = pipeline(model=model, device_map="auto")
    text=context + "\n\nQuestion: \"\"\"\n" + question + "\nPlease use markdown formatting for answer. \nAnswer:\n" 
    return generator(text)


app=gr.Interface(fn=question_answer, inputs=["text", "text"], outputs=["textbox", "text"])
app.launch()