Divyam Sharma commited on
Commit
4730f46
·
1 Parent(s): 01f983e

Adding Generation

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -78,18 +78,18 @@ demo.launch(share=True)
78
 
79
  # ### Let's add generation
80
 
81
- # with gr.Blocks() as demo:
82
- # gr.Markdown("# Describe-and-Generate game 🖍️")
83
- # image_upload = gr.Image(label="Your first image",type="pil")
84
- # btn_caption = gr.Button("Generate caption")
85
- # caption = gr.Textbox(label="Generated caption")
86
- # btn_image = gr.Button("Generate image")
87
- # image_output = gr.Image(label="Generated Image")
88
- # btn_caption.click(fn=captioner, inputs=[image_upload], outputs=[caption])
89
- # btn_image.click(fn=generate, inputs=[caption], outputs=[image_output])
90
 
91
- # gr.close_all()
92
- # demo.launch(share=True, server_port=int(os.environ['PORT2']))
93
 
94
  ### Doing it all at once
95
 
 
78
 
79
  # ### Let's add generation
80
 
81
+ with gr.Blocks() as demo:
82
+ gr.Markdown("# Describe-and-Generate game 🖍️")
83
+ image_upload = gr.Image(label="Your first image",type="pil")
84
+ btn_caption = gr.Button("Generate caption")
85
+ caption = gr.Textbox(label="Generated caption")
86
+ btn_image = gr.Button("Generate image")
87
+ image_output = gr.Image(label="Generated Image")
88
+ btn_caption.click(fn=captioner, inputs=[image_upload], outputs=[caption])
89
+ btn_image.click(fn=generate, inputs=[caption], outputs=[image_output])
90
 
91
+ gr.close_all()
92
+ demo.launch(share=True)
93
 
94
  ### Doing it all at once
95