seawolf2357 commited on
Commit
fe75251
โ€ข
1 Parent(s): 15f5b33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -48,17 +48,14 @@ async def generate_response(user_input, history, system_message, max_tokens, tem
48
  if val[1]:
49
  messages.append({"role": "assistant", "content": val[1]})
50
  messages.append({"role": "user", "content": user_input})
51
-
52
  try:
53
- # hf_client.chat_completion ํ˜ธ์ถœ
54
- response = hf_client.chat_completion(messages, max_tokens=max_tokens, stream=False, temperature=temperature, top_p=top_p)
55
- # chat_completion์ด ๋น„๋™๊ธฐ ํ•จ์ˆ˜๊ฐ€ ์•„๋‹ ๊ฒฝ์šฐ
56
  return response.choices[0].delta.content.strip()
57
  except Exception as e:
58
  logging.error(f"An error occurred: {e}")
59
  return "์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”."
60
 
61
-
62
  # ๋””์Šค์ฝ”๋“œ ๋ด‡ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ ๋ฐ ์‹คํ–‰
63
  discord_client = MyClient(intents=intents)
64
- discord_client.run(os.getenv('DISCORD_TOKEN'))
 
48
  if val[1]:
49
  messages.append({"role": "assistant", "content": val[1]})
50
  messages.append({"role": "user", "content": user_input})
51
+
52
  try:
53
+ response = await hf_client.chat_completion(messages, max_tokens=max_tokens, stream=False, temperature=temperature, top_p=top_p)
 
 
54
  return response.choices[0].delta.content.strip()
55
  except Exception as e:
56
  logging.error(f"An error occurred: {e}")
57
  return "์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”."
58
 
 
59
  # ๋””์Šค์ฝ”๋“œ ๋ด‡ ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ ๋ฐ ์‹คํ–‰
60
  discord_client = MyClient(intents=intents)
61
+ discord_client.run(os.getenv('DISCORD_TOKEN'))