Spaces:
Running
on
Zero
Running
on
Zero
get rid of old share button logic
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
-
from share_btn import community_icon_html, loading_icon_html, share_js
|
3 |
import re
|
4 |
import os
|
5 |
hf_token = os.environ.get('HF_TOKEN')
|
@@ -56,7 +55,7 @@ def infer(image_input, audience):
|
|
56 |
formatted_text = '\n\n'.join(paragraphs)
|
57 |
|
58 |
|
59 |
-
return formatted_text
|
60 |
|
61 |
css="""
|
62 |
#col-container {max-width: 910px; margin-left: auto; margin-right: auto;}
|
@@ -138,20 +137,14 @@ with gr.Blocks(css=css) as demo:
|
|
138 |
with gr.Column():
|
139 |
#caption = gr.Textbox(label="Generated Caption")
|
140 |
story = gr.Textbox(label="generated Story", elem_id="story", height=420)
|
141 |
-
|
142 |
-
with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
143 |
-
community_icon = gr.HTML(community_icon_html)
|
144 |
-
loading_icon = gr.HTML(loading_icon_html)
|
145 |
-
share_button = gr.Button("Share with community", elem_id="share-btn")
|
146 |
|
147 |
gr.Examples(examples=[["./examples/crabby.png", "Children"],["./examples/hopper.jpeg", "Adult"]],
|
148 |
fn=infer,
|
149 |
inputs=[image_in, audience],
|
150 |
-
outputs=[story
|
151 |
cache_examples=True
|
152 |
)
|
153 |
|
154 |
-
submit_btn.click(fn=infer, inputs=[image_in, audience], outputs=[story
|
155 |
-
share_button.click(None, [], [], _js=share_js)
|
156 |
|
157 |
demo.queue(max_size=12).launch()
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import re
|
3 |
import os
|
4 |
hf_token = os.environ.get('HF_TOKEN')
|
|
|
55 |
formatted_text = '\n\n'.join(paragraphs)
|
56 |
|
57 |
|
58 |
+
return formatted_text
|
59 |
|
60 |
css="""
|
61 |
#col-container {max-width: 910px; margin-left: auto; margin-right: auto;}
|
|
|
137 |
with gr.Column():
|
138 |
#caption = gr.Textbox(label="Generated Caption")
|
139 |
story = gr.Textbox(label="generated Story", elem_id="story", height=420)
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
gr.Examples(examples=[["./examples/crabby.png", "Children"],["./examples/hopper.jpeg", "Adult"]],
|
142 |
fn=infer,
|
143 |
inputs=[image_in, audience],
|
144 |
+
outputs=[story],
|
145 |
cache_examples=True
|
146 |
)
|
147 |
|
148 |
+
submit_btn.click(fn=infer, inputs=[image_in, audience], outputs=[story])
|
|
|
149 |
|
150 |
demo.queue(max_size=12).launch()
|