ashwml commited on
Commit
2e0bb48
·
1 Parent(s): b4d9036

Add application file

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ model_output_path='./output'
4
+ my_model = GPT2LMHeadModel.from_pretrained(model_output_path)
5
+ my_tokenizer = GPT2Tokenizer.from_pretrained(model_output_path)
6
+
7
+ def predict(prompt):
8
+ response = generate_response(my_model, my_tokenizer, prompt)
9
+ return response
10
+
11
+ iface = gr.Interface(fn=predict, inputs="text", outputs="text")
12
+ iface.launch()
13
+