Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,14 +46,9 @@ async def generate_response(user_input):
|
|
| 46 |
loop = asyncio.get_event_loop()
|
| 47 |
response = await loop.run_in_executor(None, lambda: hf_client.chat_completion(messages, max_tokens=4000, stream=False, temperature=0.7, top_p=0.95))
|
| 48 |
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
|
| 52 |
-
# ๋ฐํ ๊ฐ์ฒด์ ์ฌ๋ฐ๋ฅธ ์์ฑ ์ ๊ทผ ๋ฐฉ๋ฒ์ ํ์ธ
|
| 53 |
-
return response.choices[0].text.strip() # ์์ฑ๋ช
์ด ๋ณ๊ฒฝ๋์์ ์ ์์ผ๋ ํ์ธ ํ์
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
# ๋์ค์ฝ๋ ๋ด ์ธ์คํด์ค ์์ฑ ๋ฐ ์คํ
|
| 58 |
discord_client = MyClient(intents=intents)
|
| 59 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|
|
|
|
| 46 |
loop = asyncio.get_event_loop()
|
| 47 |
response = await loop.run_in_executor(None, lambda: hf_client.chat_completion(messages, max_tokens=4000, stream=False, temperature=0.7, top_p=0.95))
|
| 48 |
|
| 49 |
+
# API ์๋ต ๋ก๊ทธ์ ๋ฐ๋ผ content ์์ฑ ์ฌ์ฉ
|
| 50 |
+
return response.choices[0].message.content.strip()
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
# ๋์ค์ฝ๋ ๋ด ์ธ์คํด์ค ์์ฑ ๋ฐ ์คํ
|
| 53 |
discord_client = MyClient(intents=intents)
|
| 54 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|