johnpaulbin commited on
Commit
590c26b
Β·
verified Β·
1 Parent(s): b27a850

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -125,7 +125,7 @@ with gr.Blocks(title="Fast Translation App") as iface:
125
  translate_btn = gr.Button("Translate")
126
  translate_btn.click(fn=translate, inputs=[direction, input_text], outputs=output_text)
127
 
128
- # Add examples for convenience
129
  gr.Examples(
130
  examples=[
131
  ["English to Spanish", "Hello, how are you today?"],
@@ -134,8 +134,9 @@ with gr.Blocks(title="Fast Translation App") as iface:
134
  ["Korean to English", "였늘 날씨가 μ’‹μŠ΅λ‹ˆλ‹€."]
135
  ],
136
  inputs=[direction, input_text],
 
137
  outputs=output_text,
138
- cache_examples=True # Pre-compute examples
139
  )
140
 
141
  # Launch with optimized settings
 
125
  translate_btn = gr.Button("Translate")
126
  translate_btn.click(fn=translate, inputs=[direction, input_text], outputs=output_text)
127
 
128
+ # Add examples - FIXED VERSION
129
  gr.Examples(
130
  examples=[
131
  ["English to Spanish", "Hello, how are you today?"],
 
134
  ["Korean to English", "였늘 날씨가 μ’‹μŠ΅λ‹ˆλ‹€."]
135
  ],
136
  inputs=[direction, input_text],
137
+ fn=translate, # Added the missing function parameter
138
  outputs=output_text,
139
+ cache_examples=True
140
  )
141
 
142
  # Launch with optimized settings