Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,7 @@ huggingface에서 동작될 서비스를 만들것이기에 로컬에 라이브
|
|
45 |
|
46 |
response = ""
|
47 |
|
|
|
48 |
for message in client.chat_completion(
|
49 |
messages,
|
50 |
max_tokens=max_tokens,
|
@@ -54,10 +55,9 @@ huggingface에서 동작될 서비스를 만들것이기에 로컬에 라이브
|
|
54 |
):
|
55 |
token = message.choices[0].delta.content
|
56 |
if token is not None:
|
57 |
-
response += token
|
58 |
yield response
|
59 |
|
60 |
-
|
61 |
demo = gr.ChatInterface(
|
62 |
respond,
|
63 |
additional_inputs=[
|
|
|
45 |
|
46 |
response = ""
|
47 |
|
48 |
+
|
49 |
for message in client.chat_completion(
|
50 |
messages,
|
51 |
max_tokens=max_tokens,
|
|
|
55 |
):
|
56 |
token = message.choices[0].delta.content
|
57 |
if token is not None:
|
58 |
+
response += token.strip("<|END_OF_TURN_TOKEN|>") # 토큰 제거
|
59 |
yield response
|
60 |
|
|
|
61 |
demo = gr.ChatInterface(
|
62 |
respond,
|
63 |
additional_inputs=[
|