Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -26,20 +26,18 @@ def send(text1,context,text2):
|
|
26 |
|
27 |
with gr.Blocks() as demo:
|
28 |
textbox = gr.Textbox(placeholder="Type here and press enter...", lines=4)
|
|
|
29 |
context = gr.Slider(value=50,label="Truncate input text length",minimum=1,maximum=300)
|
30 |
-
the_model = gr.Dropdown(choices=['gpt2','gpt2-medium','gpt2-large','gpt2-xl'],value = 'gpt2',label="Choose model")
|
31 |
max_length = gr.Slider(value=50,label="Max Generate Length",minimum=1,maximum=300)
|
32 |
temperature = gr.Slider(value=1.0,label="Temperature",minimum=0.0,maximum=1.0,step=0.05)
|
33 |
repetition_penalty = gr.Slider(value=1.1,label="Repetition penalty",minimum=0.2,maximum=2,step=0.1)
|
34 |
output1 = gr.Textbox(lines=4,label='1')
|
35 |
-
output2 = gr.Textbox(lines=4,label='2')
|
36 |
-
output3 = gr.Textbox(lines=4,label='3')
|
37 |
-
btn = gr.Button("Generate")
|
38 |
-
btn.click(complete_with_gpt,inputs=[textbox,context,the_model,max_length,temperature,repetition_penalty], outputs=[output1,output2,output3])
|
39 |
-
|
40 |
send1 = gr.Button("Send1 to Origin Textbox").click(send,inputs=[textbox,context,output1],outputs=textbox)
|
|
|
41 |
send2 = gr.Button("Send2 to Origin Textbox").click(send,inputs=[textbox,context,output2],outputs=textbox)
|
|
|
42 |
send3 = gr.Button("Send3 to Origin Textbox").click(send,inputs=[textbox,context,output3],outputs=textbox)
|
43 |
-
|
44 |
|
45 |
demo.launch()
|
|
|
26 |
|
27 |
with gr.Blocks() as demo:
|
28 |
textbox = gr.Textbox(placeholder="Type here and press enter...", lines=4)
|
29 |
+
btn = gr.Button("Generate")
|
30 |
context = gr.Slider(value=50,label="Truncate input text length",minimum=1,maximum=300)
|
31 |
+
the_model = gr.Dropdown(choices=['gpt2','gpt2-medium','gpt2-large','gpt2-xl','EleutherAI/gpt-neo-2.7B','EleutherAI/gpt-j-6B'],value = 'gpt2',label="Choose model")
|
32 |
max_length = gr.Slider(value=50,label="Max Generate Length",minimum=1,maximum=300)
|
33 |
temperature = gr.Slider(value=1.0,label="Temperature",minimum=0.0,maximum=1.0,step=0.05)
|
34 |
repetition_penalty = gr.Slider(value=1.1,label="Repetition penalty",minimum=0.2,maximum=2,step=0.1)
|
35 |
output1 = gr.Textbox(lines=4,label='1')
|
|
|
|
|
|
|
|
|
|
|
36 |
send1 = gr.Button("Send1 to Origin Textbox").click(send,inputs=[textbox,context,output1],outputs=textbox)
|
37 |
+
output2 = gr.Textbox(lines=4,label='2')
|
38 |
send2 = gr.Button("Send2 to Origin Textbox").click(send,inputs=[textbox,context,output2],outputs=textbox)
|
39 |
+
output3 = gr.Textbox(lines=4,label='3')
|
40 |
send3 = gr.Button("Send3 to Origin Textbox").click(send,inputs=[textbox,context,output3],outputs=textbox)
|
41 |
+
btn.click(complete_with_gpt,inputs=[textbox,context,the_model,max_length,temperature,repetition_penalty], outputs=[output1,output2,output3])
|
42 |
|
43 |
demo.launch()
|