Update app.py
Browse files
app.py
CHANGED
|
@@ -14,8 +14,14 @@ generation_config = {
|
|
| 14 |
"max_output_tokens": 8192,
|
| 15 |
"response_mime_type": "text/plain",
|
| 16 |
}
|
| 17 |
-
model_name = "gemini-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
model = genai.GenerativeModel(
|
| 21 |
model_name=model_name,
|
|
@@ -51,7 +57,7 @@ with gr.Blocks() as demo:
|
|
| 51 |
state = gr.State([]) # For chat history
|
| 52 |
|
| 53 |
with gr.Row():
|
| 54 |
-
txt = gr.Textbox(show_label=False, placeholder="
|
| 55 |
txt.submit(chatbot, [txt, state], [chatbot_interface, state])
|
| 56 |
|
| 57 |
demo.launch()
|
|
|
|
| 14 |
"max_output_tokens": 8192,
|
| 15 |
"response_mime_type": "text/plain",
|
| 16 |
}
|
| 17 |
+
model_name = "gemini-flash2-exp" # Use the updated model
|
| 18 |
+
|
| 19 |
+
# Update the system instruction to meet the requirements
|
| 20 |
+
system_instruction = (
|
| 21 |
+
"Eres un tutor experto que responde exclusivamente en castellano o catalán. "
|
| 22 |
+
"Tus respuestas deben centrarse únicamente en temas de estadística básica y "
|
| 23 |
+
"todo el código proporcionado debe implementarse exclusivamente en R."
|
| 24 |
+
)
|
| 25 |
|
| 26 |
model = genai.GenerativeModel(
|
| 27 |
model_name=model_name,
|
|
|
|
| 57 |
state = gr.State([]) # For chat history
|
| 58 |
|
| 59 |
with gr.Row():
|
| 60 |
+
txt = gr.Textbox(show_label=False, placeholder="Escribe tu pregunta aquí...")
|
| 61 |
txt.submit(chatbot, [txt, state], [chatbot_interface, state])
|
| 62 |
|
| 63 |
demo.launch()
|