Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def clear_chat(message, chat_history):
|
|
21 |
def add_new_message(message,person, chat_history):
|
22 |
new_chat = []
|
23 |
|
24 |
-
new_chat.append({"role": "system", "content": 'Sos {} y tendrás que responder preguntas que te harán
|
25 |
|
26 |
for turn in chat_history:
|
27 |
user, bot = turn
|
@@ -41,7 +41,7 @@ def respond(message, person, chat_history):
|
|
41 |
# #stop_sequences to not generate the user answer
|
42 |
# acc_text = ""
|
43 |
response = openai.ChatCompletion.create(
|
44 |
-
model="gpt-
|
45 |
messages= prompt,
|
46 |
temperature=0.5,
|
47 |
max_tokens=1000,
|
@@ -79,12 +79,12 @@ with gr.Blocks() as demo:
|
|
79 |
</h1>
|
80 |
<img src='data:image/jpg;base64,{}' width=200px>
|
81 |
<h3>
|
82 |
-
Con este espacio podrás hablar en formato conversación con el personaje famoso que quieras, puede ser Albert Einstein, Marie Curie o
|
83 |
</h3>
|
84 |
</center>
|
85 |
""".format(encoded_image))
|
86 |
with gr.Row():
|
87 |
-
person = gr.Textbox(label="Escribí el nombre del
|
88 |
with gr.Row():
|
89 |
chatbot = gr.Chatbot( height=550) #just to fit the notebook
|
90 |
with gr.Row():
|
|
|
21 |
def add_new_message(message,person, chat_history):
|
22 |
new_chat = []
|
23 |
|
24 |
+
new_chat.append({"role": "system", "content": 'Sos {} y tendrás que responder preguntas que te harán escolares entre 7 y 11 años. La idea es que sea como una entrevista en la cual te debes comportar como si fueras {}, por lo que tus respuestas deben corresponder con la información de la vida real de {}. Las respuestas tienen que estar orientadas a escolares entre 7 y 11 años. No respondas preguntas hasta que te pregunten sobre algún tema.'.format(person,person)})
|
25 |
|
26 |
for turn in chat_history:
|
27 |
user, bot = turn
|
|
|
41 |
# #stop_sequences to not generate the user answer
|
42 |
# acc_text = ""
|
43 |
response = openai.ChatCompletion.create(
|
44 |
+
model="gpt-4-0125-preview",
|
45 |
messages= prompt,
|
46 |
temperature=0.5,
|
47 |
max_tokens=1000,
|
|
|
79 |
</h1>
|
80 |
<img src='data:image/jpg;base64,{}' width=200px>
|
81 |
<h3>
|
82 |
+
Con este espacio podrás hablar en formato conversación con el personaje famoso que quieras, puede ser Albert Einstein, Marie Curie o quien quieras!
|
83 |
</h3>
|
84 |
</center>
|
85 |
""".format(encoded_image))
|
86 |
with gr.Row():
|
87 |
+
person = gr.Textbox(label="Escribí el nombre del personaje famoso:")
|
88 |
with gr.Row():
|
89 |
chatbot = gr.Chatbot( height=550) #just to fit the notebook
|
90 |
with gr.Row():
|