seawolf2357 commited on
Commit
a2aef79
โ€ข
1 Parent(s): a0d56d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -22,9 +22,7 @@ intents.messages = True
22
  intents.guilds = True
23
  intents.guild_messages = True
24
 
25
-
26
  # ์ถ”๋ก  API ํด๋ผ์ด์–ธํŠธ ์„ค์ •
27
- # hf_client = InferenceClient("CohereForAI/c4ai-command-r-plus", token=os.getenv("HF_TOKEN"))
28
  hf_client = InferenceClient("CohereForAI/aya-23-35B", token=os.getenv("HF_TOKEN"))
29
 
30
  # PaliGemma ๋ชจ๋ธ ์„ค์ • (CPU ๋ชจ๋“œ)
@@ -146,7 +144,7 @@ def run_gradio():
146
  )
147
 
148
  # ํŠน์ • ์ฑ„๋„ ID ์„ค์ •
149
- SPECIFIC_CHANNEL_ID = int(os.getenv("DISCORD_CHANNEL_ID", "123456789012345678")) # ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ๋˜๋Š” ์ง์ ‘ ์„ค์ •
150
 
151
  # ๋””์Šค์ฝ”๋“œ ๋ด‡ ์„ค์ •
152
  class MyClient(discord.Client):
@@ -173,7 +171,6 @@ class MyClient(discord.Client):
173
  response = await process_image(image_url, message)
174
  await message.channel.send(response)
175
  else:
176
- # ์‚ฌ์šฉ์ž ๋ฉ”์‹œ์ง€๋ฅผ ์ฒ˜๋ฆฌํ•˜์—ฌ Cohere ๋ชจ๋ธ๊ณผ ์ƒํ˜ธ์ž‘์šฉ
177
  response = await interact_with_model(message.content)
178
  await message.channel.send(response)
179
  finally:
@@ -193,10 +190,9 @@ async def process_image(image_url, message):
193
 
194
  async def download_image(url):
195
  response = requests.get(url)
196
- image = Image.open(io.BytesIO(response.content)).convert("RGB") # ์ด๋ฏธ์ง€ ๋ณ€ํ™˜
197
  return image
198
 
199
  if __name__ == "__main__":
200
  discord_client = MyClient(intents=intents)
201
  discord_client.run(os.getenv('DISCORD_TOKEN'))
202
-
 
22
  intents.guilds = True
23
  intents.guild_messages = True
24
 
 
25
  # ์ถ”๋ก  API ํด๋ผ์ด์–ธํŠธ ์„ค์ •
 
26
  hf_client = InferenceClient("CohereForAI/aya-23-35B", token=os.getenv("HF_TOKEN"))
27
 
28
  # PaliGemma ๋ชจ๋ธ ์„ค์ • (CPU ๋ชจ๋“œ)
 
144
  )
145
 
146
  # ํŠน์ • ์ฑ„๋„ ID ์„ค์ •
147
+ SPECIFIC_CHANNEL_ID = int(os.getenv("DISCORD_CHANNEL_ID", "123456789012345678"))
148
 
149
  # ๋””์Šค์ฝ”๋“œ ๋ด‡ ์„ค์ •
150
  class MyClient(discord.Client):
 
171
  response = await process_image(image_url, message)
172
  await message.channel.send(response)
173
  else:
 
174
  response = await interact_with_model(message.content)
175
  await message.channel.send(response)
176
  finally:
 
190
 
191
  async def download_image(url):
192
  response = requests.get(url)
193
+ image = Image.open(io.BytesIO(response.content)).convert("RGB")
194
  return image
195
 
196
  if __name__ == "__main__":
197
  discord_client = MyClient(intents=intents)
198
  discord_client.run(os.getenv('DISCORD_TOKEN'))