Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -113,8 +113,27 @@ model_choice_component = gr.Dropdown(
|
|
113 |
scale=2
|
114 |
)
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
user_inputs = [text_prompt_component, chatbot_component]
|
117 |
-
bot_inputs = [upload_button_component, model_choice_component, system_instruction_component, chatbot_component]
|
118 |
|
119 |
# Definir la interfaz de usuario
|
120 |
with gr.Blocks() as demo:
|
@@ -133,6 +152,11 @@ with gr.Blocks() as demo:
|
|
133 |
with gr.Accordion("System Instruction", open=False): # Acorde贸n cerrado por defecto
|
134 |
system_instruction_component.render()
|
135 |
|
|
|
|
|
|
|
|
|
|
|
136 |
run_button_component.click(
|
137 |
fn=user,
|
138 |
inputs=user_inputs,
|
|
|
113 |
scale=2
|
114 |
)
|
115 |
|
116 |
+
# Nuevos dropdowns para personalizar la entrada
|
117 |
+
genre_component = gr.Dropdown(
|
118 |
+
choices=["History", "Poem", "Short Story", "Quote"],
|
119 |
+
label="Select Genre",
|
120 |
+
scale=2
|
121 |
+
)
|
122 |
+
|
123 |
+
language_component = gr.Dropdown(
|
124 |
+
choices=["English", "Spanish", "French"],
|
125 |
+
label="Select Language",
|
126 |
+
scale=2
|
127 |
+
)
|
128 |
+
|
129 |
+
mood_component = gr.Dropdown(
|
130 |
+
choices=["Happy", "Sad", "Romantic", "Horror", "Comical"],
|
131 |
+
label="Select Mood",
|
132 |
+
scale=2
|
133 |
+
)
|
134 |
+
|
135 |
user_inputs = [text_prompt_component, chatbot_component]
|
136 |
+
bot_inputs = [upload_button_component, model_choice_component, system_instruction_component, chatbot_component, genre_component, language_component, mood_component]
|
137 |
|
138 |
# Definir la interfaz de usuario
|
139 |
with gr.Blocks() as demo:
|
|
|
152 |
with gr.Accordion("System Instruction", open=False): # Acorde贸n cerrado por defecto
|
153 |
system_instruction_component.render()
|
154 |
|
155 |
+
# Agregar los nuevos desplegables (dropdowns) para personalizaci贸n
|
156 |
+
genre_component.render()
|
157 |
+
language_component.render()
|
158 |
+
mood_component.render()
|
159 |
+
|
160 |
run_button_component.click(
|
161 |
fn=user,
|
162 |
inputs=user_inputs,
|