Spaces:
Build error
Build error
Fix community button
Browse files- app.py +5 -5
- share_btn.py +2 -1
app.py
CHANGED
@@ -169,8 +169,7 @@ with gr.Blocks(css=css) as demo:
|
|
169 |
save_button = gr.Button("💾 Save Conversation as .png", elem_id="save-btn")
|
170 |
|
171 |
with gr.Row(visible=False) as share_group:
|
172 |
-
share_button = gr.Button("🤗 Share to Community", elem_id="share-btn")
|
173 |
-
|
174 |
|
175 |
with gr.Column(scale=0.3, min_width=400):
|
176 |
ret_scale_factor = gr.Slider(minimum=0.0, maximum=3.0, value=1.0, step=0.1, interactive=True,
|
@@ -182,9 +181,10 @@ with gr.Blocks(css=css) as demo:
|
|
182 |
gr_temperature = gr.Slider(
|
183 |
minimum=0.0, maximum=1.0, value=0.0, interactive=True, label="Temperature (0 for deterministic, higher for more randomness)")
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
|
|
188 |
|
189 |
text_input.submit(generate_for_prompt, [text_input, gr_state, ret_scale_factor,
|
190 |
max_ret_images, gr_max_len, gr_temperature], [gr_state, chatbot, share_group, save_group])
|
|
|
169 |
save_button = gr.Button("💾 Save Conversation as .png", elem_id="save-btn")
|
170 |
|
171 |
with gr.Row(visible=False) as share_group:
|
172 |
+
share_button = gr.Button("🤗 Share to Community (opens new window)", elem_id="share-btn")
|
|
|
173 |
|
174 |
with gr.Column(scale=0.3, min_width=400):
|
175 |
ret_scale_factor = gr.Slider(minimum=0.0, maximum=3.0, value=1.0, step=0.1, interactive=True,
|
|
|
181 |
gr_temperature = gr.Slider(
|
182 |
minimum=0.0, maximum=1.0, value=0.0, interactive=True, label="Temperature (0 for deterministic, higher for more randomness)")
|
183 |
|
184 |
+
with gr.Row(min_height=10000):
|
185 |
+
gallery = gr.Gallery(
|
186 |
+
value=[Image.open(e) for e in examples], label="Example Conversations", show_label=True, elem_id="gallery",
|
187 |
+
).style(grid=[5], height="10000")
|
188 |
|
189 |
text_input.submit(generate_for_prompt, [text_input, gr_state, ret_scale_factor,
|
190 |
max_ret_images, gr_max_len, gr_temperature], [gr_state, chatbot, share_group, save_group])
|
share_btn.py
CHANGED
@@ -44,9 +44,10 @@ async () => {
|
|
44 |
const gradioEl = document.querySelector("gradio-app").shadowRoot || document.querySelector('body > gradio-app');
|
45 |
const chatbotEl = gradioEl.querySelector('#chatbot')
|
46 |
const imageFile = await getImageFile(chatbotEl);
|
|
|
47 |
const urlChatbotImage = await uploadFile(imageFile);
|
48 |
console.log(urlChatbotImage);
|
49 |
-
let titleTxt = `FROMAGe`;
|
50 |
|
51 |
//const shareBtnEl = gradioEl.querySelector('#share-btn');
|
52 |
//shareBtnEl.style.pointerEvents = 'none';
|
|
|
44 |
const gradioEl = document.querySelector("gradio-app").shadowRoot || document.querySelector('body > gradio-app');
|
45 |
const chatbotEl = gradioEl.querySelector('#chatbot')
|
46 |
const imageFile = await getImageFile(chatbotEl);
|
47 |
+
console.log(imageFile);
|
48 |
const urlChatbotImage = await uploadFile(imageFile);
|
49 |
console.log(urlChatbotImage);
|
50 |
+
let titleTxt = `FROMAGe Example`;
|
51 |
|
52 |
//const shareBtnEl = gradioEl.querySelector('#share-btn');
|
53 |
//shareBtnEl.style.pointerEvents = 'none';
|