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()}"
|