Kumarkishalaya commited on
Commit
8cc2393
1 Parent(s): e648a11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -12,5 +12,13 @@ def generate(commentary_text):
12
  output = trained_model.generate(input_ids, max_length=60, num_beams=5, do_sample=False)
13
  return tokenizer_finetuned.decode(output[0])
14
 
15
- demo = gr.Interface(fn=generate, inputs="text", outputs="text")
16
- demo.launch()
 
 
 
 
 
 
 
 
 
12
  output = trained_model.generate(input_ids, max_length=60, num_beams=5, do_sample=False)
13
  return tokenizer_finetuned.decode(output[0])
14
 
15
+ # Create Gradio interface
16
+ iface = gr.Interface(fn=generate_text,
17
+ inputs="text",
18
+ outputs="text",
19
+ title="GPT-2 Text Generation",
20
+ description="Enter a prompt and GPT-2 will generate the continuation of the text.")
21
+
22
+ # Launch the app
23
+ if __name__ == "__main__":
24
+ iface.launch()