Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,8 +45,10 @@ async def generate_response(user_input):
|
|
45 |
|
46 |
# ๋๊ธฐ ํจ์๋ฅผ ๋น๋๊ธฐ๋ก ์ฒ๋ฆฌํ๊ธฐ ์ํ ๋ํผ ์ฌ์ฉ
|
47 |
loop = asyncio.get_event_loop()
|
48 |
-
response = await loop.run_in_executor(None, lambda: hf_client.chat_completion(messages, max_tokens=
|
49 |
-
|
|
|
|
|
50 |
|
51 |
# ๋์ค์ฝ๋ ๋ด ์ธ์คํด์ค ์์ฑ ๋ฐ ์คํ
|
52 |
discord_client = MyClient(intents=intents)
|
|
|
45 |
|
46 |
# ๋๊ธฐ ํจ์๋ฅผ ๋น๋๊ธฐ๋ก ์ฒ๋ฆฌํ๊ธฐ ์ํ ๋ํผ ์ฌ์ฉ
|
47 |
loop = asyncio.get_event_loop()
|
48 |
+
response = await loop.run_in_executor(None, lambda: hf_client.chat_completion(messages, max_tokens=1000, stream=False, temperature=0.7, top_p=0.95))
|
49 |
+
# dataclass ์์ฑ ์ ๊ทผ์ผ๋ก ์์
|
50 |
+
return response.choices[0].text.strip()
|
51 |
+
|
52 |
|
53 |
# ๋์ค์ฝ๋ ๋ด ์ธ์คํด์ค ์์ฑ ๋ฐ ์คํ
|
54 |
discord_client = MyClient(intents=intents)
|