Would it work now?
Browse files
app.py
CHANGED
@@ -300,12 +300,14 @@ with gr.Blocks(css=css, theme="ParityError/Interstellar") as demo:
|
|
300 |
max_length = 180
|
301 |
|
302 |
# Function to handle example clicks - sets prompt and disables enrichment
|
303 |
-
def set_example_and_disable_enrichment(example):
|
|
|
304 |
return example, gr.update(value=False) # Explicitly disable enrichment
|
305 |
|
306 |
gr.Examples(
|
307 |
examples=examples,
|
308 |
-
inputs
|
|
|
309 |
outputs=[prompt, use_prompt_enrichment],
|
310 |
fn=set_example_and_disable_enrichment, # Use the updated function
|
311 |
example_labels=[ex[:max_length] + "..." if len(ex) > max_length else ex for ex in examples]
|
|
|
300 |
max_length = 180
|
301 |
|
302 |
# Function to handle example clicks - sets prompt and disables enrichment
|
303 |
+
def set_example_and_disable_enrichment(example, current_checkbox_value):
|
304 |
+
# The current_checkbox_value is not used, but required by Gradio's input mapping
|
305 |
return example, gr.update(value=False) # Explicitly disable enrichment
|
306 |
|
307 |
gr.Examples(
|
308 |
examples=examples,
|
309 |
+
# Add use_prompt_enrichment to inputs
|
310 |
+
inputs=[prompt, use_prompt_enrichment],
|
311 |
outputs=[prompt, use_prompt_enrichment],
|
312 |
fn=set_example_and_disable_enrichment, # Use the updated function
|
313 |
example_labels=[ex[:max_length] + "..." if len(ex) > max_length else ex for ex in examples]
|