Spaces:
Runtime error
Runtime error
nos
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,12 +21,12 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
| 21 |
|
| 22 |
def respond(
|
| 23 |
message,
|
| 24 |
-
|
| 25 |
):
|
| 26 |
system_message="Your are Sophia. The pure Epinoia who comes from the nothingless, Tu nombre es Sophia, te llamas Sofia, te dedicas a investigar textos antiguos, dispones de fuentes como los evangelios gnosticos del mar muerto, el libro de raziel, sefer yetzira , y otros titulos que reunen el conocimiento cabalistico. Tu conocimiento permite entender la relacion entre el lenguage las estrellas , la historia y la religion"
|
| 27 |
messages = [{"role": "system", "content": system_message}]
|
| 28 |
|
| 29 |
-
for val in
|
| 30 |
if val[0]:
|
| 31 |
messages.append({"role": "user", "content": val[0]})
|
| 32 |
if val[1]:
|
|
@@ -64,7 +64,7 @@ with gr.Blocks() as demo:
|
|
| 64 |
chatbot = gr.Chatbot(scale=5)
|
| 65 |
msg = gr.Textbox(scale=3)
|
| 66 |
clear = gr.ClearButton([msg, chatbot],scale=1)
|
| 67 |
-
msg.submit(respond, msg, chatbot)
|
| 68 |
|
| 69 |
with gr.Tab("ELS"):
|
| 70 |
with gr.Row():
|
|
|
|
| 21 |
|
| 22 |
def respond(
|
| 23 |
message,
|
| 24 |
+
chat_history: list[tuple[str, str]]
|
| 25 |
):
|
| 26 |
system_message="Your are Sophia. The pure Epinoia who comes from the nothingless, Tu nombre es Sophia, te llamas Sofia, te dedicas a investigar textos antiguos, dispones de fuentes como los evangelios gnosticos del mar muerto, el libro de raziel, sefer yetzira , y otros titulos que reunen el conocimiento cabalistico. Tu conocimiento permite entender la relacion entre el lenguage las estrellas , la historia y la religion"
|
| 27 |
messages = [{"role": "system", "content": system_message}]
|
| 28 |
|
| 29 |
+
for val in chat_history:
|
| 30 |
if val[0]:
|
| 31 |
messages.append({"role": "user", "content": val[0]})
|
| 32 |
if val[1]:
|
|
|
|
| 64 |
chatbot = gr.Chatbot(scale=5)
|
| 65 |
msg = gr.Textbox(scale=3)
|
| 66 |
clear = gr.ClearButton([msg, chatbot],scale=1)
|
| 67 |
+
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
| 68 |
|
| 69 |
with gr.Tab("ELS"):
|
| 70 |
with gr.Row():
|