Update app.py
Browse files
app.py
CHANGED
|
@@ -72,3 +72,13 @@ fact_extraction_chain = LLMChain(llm=llm_hf, prompt=fact_extraction_prompt)
|
|
| 72 |
facts = fact_extraction_chain.run(text + " " +output_question_1)
|
| 73 |
|
| 74 |
print(facts)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
facts = fact_extraction_chain.run(text + " " +output_question_1)
|
| 73 |
|
| 74 |
print(facts)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def func (message):
|
| 78 |
+
inputs = tokenizer(message, return_tensors="pt")
|
| 79 |
+
result = model.generate(**inputs)
|
| 80 |
+
return tokenizer.decode(result[0])
|
| 81 |
+
|
| 82 |
+
import gradio as gr
|
| 83 |
+
app = gr.Interface(fn=func, inputs="textbox", outputs="textbox", title="Conversation Bot")
|
| 84 |
+
app.launch()
|