Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,7 @@ def load_parquet(filename: str) -> str:
|
|
30 |
except Exception as e:
|
31 |
return f"νμΌμ μ½λ μ€ μ€λ₯κ° λ°μνμ΅λλ€: {str(e)}"
|
32 |
|
|
|
33 |
def respond(
|
34 |
message: str,
|
35 |
history: List[Dict[str, str]],
|
@@ -53,7 +54,7 @@ def respond(
|
|
53 |
else:
|
54 |
system_prefix = system_message or "λλ AI μ‘°μΈμ μν μ΄λ€."
|
55 |
|
56 |
-
# λ©μμ§ μμ±
|
57 |
prompt = system_prefix + "\n\n"
|
58 |
for chat in history:
|
59 |
if chat['role'] == 'user':
|
@@ -73,9 +74,8 @@ def respond(
|
|
73 |
top_p=top_p,
|
74 |
)
|
75 |
for msg in stream:
|
76 |
-
|
77 |
-
|
78 |
-
response += token
|
79 |
yield response
|
80 |
except Exception as e:
|
81 |
error_message = f"μΆλ‘ μ€ μ€λ₯κ° λ°μνμ΅λλ€: {str(e)}\n{traceback.format_exc()}"
|
|
|
30 |
except Exception as e:
|
31 |
return f"νμΌμ μ½λ μ€ μ€λ₯κ° λ°μνμ΅λλ€: {str(e)}"
|
32 |
|
33 |
+
|
34 |
def respond(
|
35 |
message: str,
|
36 |
history: List[Dict[str, str]],
|
|
|
54 |
else:
|
55 |
system_prefix = system_message or "λλ AI μ‘°μΈμ μν μ΄λ€."
|
56 |
|
57 |
+
# λ©μμ§ μμ±
|
58 |
prompt = system_prefix + "\n\n"
|
59 |
for chat in history:
|
60 |
if chat['role'] == 'user':
|
|
|
74 |
top_p=top_p,
|
75 |
)
|
76 |
for msg in stream:
|
77 |
+
if msg:
|
78 |
+
response += msg
|
|
|
79 |
yield response
|
80 |
except Exception as e:
|
81 |
error_message = f"μΆλ‘ μ€ μ€λ₯κ° λ°μνμ΅λλ€: {str(e)}\n{traceback.format_exc()}"
|