Spaces:
Runtime error
Runtime error
Se retorno todo
Browse files
app.py
CHANGED
@@ -15,27 +15,15 @@ def respond(
|
|
15 |
temperature,
|
16 |
top_p,
|
17 |
):
|
18 |
-
|
19 |
-
{"from": "system", "value": system_message}
|
20 |
-
]
|
21 |
|
22 |
-
for
|
23 |
-
if
|
24 |
-
|
25 |
-
if
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
# Convertir el formato de conversaciones al formato esperado por la API
|
31 |
-
messages = []
|
32 |
-
for conv in conversations:
|
33 |
-
if conv["from"] == "system":
|
34 |
-
messages.append({"role": "system", "content": conv["value"]})
|
35 |
-
elif conv["from"] == "human":
|
36 |
-
messages.append({"role": "user", "content": conv["value"]})
|
37 |
-
elif conv["from"] == "gpt":
|
38 |
-
messages.append({"role": "assistant", "content": conv["value"]})
|
39 |
|
40 |
response = ""
|
41 |
|
|
|
15 |
temperature,
|
16 |
top_p,
|
17 |
):
|
18 |
+
messages = [{"role": "system", "content": system_message}]
|
|
|
|
|
19 |
|
20 |
+
for val in history:
|
21 |
+
if val[0]:
|
22 |
+
messages.append({"role": "user", "content": val[0]})
|
23 |
+
if val[1]:
|
24 |
+
messages.append({"role": "assistant", "content": val[1]})
|
25 |
|
26 |
+
messages.append({"role": "user", "content": message})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
response = ""
|
29 |
|