seawolf2357 commited on
Commit
2276533
β€’
1 Parent(s): 4ba4468

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
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
- logging.debug(f"API Response: {response}")
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'))