Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,24 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
# # Load the fine-tuned model and tokenizer
|
| 6 |
+
# my_model = GPT2LMHeadModel.from_pretrained(model_output_path)
|
| 7 |
+
# my_tokenizer = GPT2Tokenizer.from_pretrained(model_output_path)
|
| 8 |
+
|
| 9 |
+
# def generative_qna(input):
|
| 10 |
+
# response = generate_response(my_model, my_tokenizer, input)
|
| 11 |
+
# return response
|
| 12 |
+
|
| 13 |
+
def generative_qna():
|
| 14 |
+
print("Hi")
|
| 15 |
+
|
| 16 |
+
app = gr.Interface(fn=generative_qna, inputs=[gr.Textbox(label="Question", lines=3)],
|
| 17 |
+
outputs=[gr.Textbox(label="Answer", lines=6)],
|
| 18 |
+
title="Generative QnA System",
|
| 19 |
+
description="Generative QnA with GPT2"
|
| 20 |
+
)
|
| 21 |
+
app.launch(share=True)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
# gr.load("models/jeevana/GenerativeQnASystem").launch()
|