Spaces:
Running on Zero
Running on Zero
Commit ·
dda5759
1
Parent(s): 5801600
Update default template
Browse files
app.py
CHANGED
|
@@ -192,22 +192,17 @@ def update_mode_ui(mode):
|
|
| 192 |
show_src = mode == "Translation"
|
| 193 |
show_tgt = mode == "Translation"
|
| 194 |
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
prompt_label = "Text to Translate"
|
| 203 |
-
prompt_placeholder = "Enter text to translate..."
|
| 204 |
-
else:
|
| 205 |
-
prompt_label = "Prompt"
|
| 206 |
-
prompt_placeholder = "Enter your prompt here..."
|
| 207 |
|
| 208 |
return (
|
| 209 |
gr.update(visible=show_sys),
|
| 210 |
-
gr.update(label=
|
| 211 |
gr.update(visible=show_ctx),
|
| 212 |
gr.update(visible=show_src),
|
| 213 |
gr.update(visible=show_tgt),
|
|
|
|
| 192 |
show_src = mode == "Translation"
|
| 193 |
show_tgt = mode == "Translation"
|
| 194 |
|
| 195 |
+
defaults = {
|
| 196 |
+
"Completion": ("Prompt", "Enter your prompt here...", "Once upon a time in a digital kingdom,"),
|
| 197 |
+
"Chat": ("User Message", "Type your message...", "What is the capital of France?"),
|
| 198 |
+
"Q&A": ("Question", "Enter your question...", "How does photosynthesis work?"),
|
| 199 |
+
"Translation": ("Text to Translate", "Enter text to translate...", "Hello, how are you today?"),
|
| 200 |
+
}
|
| 201 |
+
label, placeholder, default = defaults.get(mode, defaults["Completion"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
|
| 203 |
return (
|
| 204 |
gr.update(visible=show_sys),
|
| 205 |
+
gr.update(label=label, placeholder=placeholder, value=default),
|
| 206 |
gr.update(visible=show_ctx),
|
| 207 |
gr.update(visible=show_src),
|
| 208 |
gr.update(visible=show_tgt),
|