rafaldembski commited on
Commit
645eee9
1 Parent(s): 4be0ad4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -85,15 +85,16 @@ def clear_chat():
85
  return [], [], str(uuid.uuid4())
86
 
87
  # Funkcja zmieniająca język interfejsu
88
- def change_language(language):
89
  selected_translation = translations[language]
90
- return (
91
- gr.update(placeholder=selected_translation["input_placeholder"]),
92
- gr.update(value=selected_translation["submit_button"]),
93
- gr.update(value=selected_translation["clear_button"]),
94
- selected_translation["examples"],
95
- selected_translation["description"]
96
- )
 
97
 
98
  # Funkcja do wywoływania przykładów
99
  def trigger_example(example):
@@ -220,7 +221,7 @@ with gr.Blocks(analytics_enabled=False, theme=gr.themes.Monochrome()) as demo:
220
  examples_per_page=100
221
  )
222
 
223
- language_selector.change(fn=change_language, inputs=[language_selector], outputs=[user_message, submit_button, clear_button, examples, description])
224
 
225
  if __name__ == "__main__":
226
  demo.queue(api_open=False, max_size=40).launch(show_api=False)
 
85
  return [], [], str(uuid.uuid4())
86
 
87
  # Funkcja zmieniająca język interfejsu
88
+ def change_language(language, user_message, submit_button, clear_button, examples):
89
  selected_translation = translations[language]
90
+
91
+ user_message.update(placeholder=selected_translation["input_placeholder"])
92
+ submit_button.update(value=selected_translation["submit_button"])
93
+ clear_button.update(value=selected_translation["clear_button"])
94
+
95
+ examples.update(examples=selected_translation["examples"])
96
+
97
+ return selected_translation["description"]
98
 
99
  # Funkcja do wywoływania przykładów
100
  def trigger_example(example):
 
221
  examples_per_page=100
222
  )
223
 
224
+ language_selector.change(fn=change_language, inputs=[language_selector, user_message, submit_button, clear_button, examples], outputs=[description])
225
 
226
  if __name__ == "__main__":
227
  demo.queue(api_open=False, max_size=40).launch(show_api=False)