Luis Oala commited on
Commit
40aeecc
·
1 Parent(s): 9249236

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -15,7 +15,7 @@ description = "based on the gpt2 demo interface by <a href='https://huggingface.
15
  generator = pipeline('text-generation', model='gpt2')
16
 
17
 
18
- io2 = gr.Interface.load("huggingface/gpt2-large")
19
 
20
  #io3 = gr.Interface.load("huggingface/gpt2-medium")
21
 
@@ -41,11 +41,12 @@ def inference(text, seed):
41
 
42
  gr.Interface(
43
  inference,
44
- [gr.inputs.Textbox(label="input", placeholder="trustworthy artificial intelligence"), gr.inputs.Number(label="seed")],
45
  #,gr.inputs.Dropdown(choices=["distilgpt2","gpt2-medium","gpt2-large","gpt2-xl"], type="value", default="gpt2-medium", label="model")],
46
  gr.outputs.Textbox(label="gpt-2 proposal"),
47
  #title=title,
48
  #description=description,
49
- cache_examples=True).launch(enable_queue=True)
 
50
 
51
  #TODO: add credits at bottom
 
15
  generator = pipeline('text-generation', model='gpt2')
16
 
17
 
18
+ #io2 = gr.Interface.load("huggingface/gpt2-large")
19
 
20
  #io3 = gr.Interface.load("huggingface/gpt2-medium")
21
 
 
41
 
42
  gr.Interface(
43
  inference,
44
+ [gr.inputs.Radio(choices=["trustworthy artificial intelligence"], value="trustworthy artificial intelligence", label="input", show_label=False), gr.inputs.Slider(minimum=0., maximum=1000ö, value=43.,label="seed")],
45
  #,gr.inputs.Dropdown(choices=["distilgpt2","gpt2-medium","gpt2-large","gpt2-xl"], type="value", default="gpt2-medium", label="model")],
46
  gr.outputs.Textbox(label="gpt-2 proposal"),
47
  #title=title,
48
  #description=description,
49
+ cache_examples=True).launch(enable_queue=True,
50
+ allow_flagging="manual")
51
 
52
  #TODO: add credits at bottom