Araeynn commited on
Commit
70b6304
·
verified ·
1 Parent(s): 2d95e50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -5
app.py CHANGED
@@ -16,7 +16,7 @@ import os
16
  from gradio_client import Client
17
 
18
  async def C(x):
19
- c = Client("https://ybelkada-llava-1-5-dlai.hf.space/--replicas/5ppw4/")
20
  print(c.view_api(return_format="dict"))
21
  result = c.predict(
22
  "Make a detailed description of the image. This would be sufficient for an LLM to answer questions about it with just your answer.",
@@ -85,7 +85,9 @@ proteus = "dataautogpt3/ProteusV0.2"
85
  sd_2_1 = "stabilityai/stable-diffusion-2-1"
86
  open_journey = "prompthero/openjourney-v4"
87
  SD = AsyncInferenceClient(model=sd_2_1)
88
- SDT = AsyncInferenceClient(model=sdxl_turbo)
 
 
89
  PT = AsyncInferenceClient(model=proteus)
90
  LLM = AsyncInferenceClient(model="openchat/openchat-3.5-0106")
91
  RF = AsyncInferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
@@ -143,9 +145,9 @@ async def on_disconnect():
143
  print("Disconnected, Clone status:", clone)
144
 
145
  setupCommand = """
146
- ## Command: --setup
147
 
148
- The --setup command enables Lyre to communicate within a designated channel.
149
 
150
  ## Usage:
151
  ```css
@@ -169,6 +171,31 @@ or
169
 
170
  """
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  @client.event
173
  async def on_message(message):
174
  msgchannel = message.channel
@@ -374,7 +401,7 @@ async def on_message(message):
374
  e = await message.reply(embed=embed)
375
  if imgp != "":
376
  np = """lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature"""
377
- image = await SD.text_to_image(imgp, negative_prompt=np)
378
  image.save("image.png")
379
  embed.set_footer(
380
  text=
 
16
  from gradio_client import Client
17
 
18
  async def C(x):
19
+ c = Client(src="ybelkada/llava-1-5-dlai")
20
  print(c.view_api(return_format="dict"))
21
  result = c.predict(
22
  "Make a detailed description of the image. This would be sufficient for an LLM to answer questions about it with just your answer.",
 
85
  sd_2_1 = "stabilityai/stable-diffusion-2-1"
86
  open_journey = "prompthero/openjourney-v4"
87
  SD = AsyncInferenceClient(model=sd_2_1)
88
+ SDXL = AsyncInferenceClient(model=sdxl)
89
+ SDXLT = AsyncInferenceClient(model=sdxl_turbo)
90
+ SDT = AsyncInferenceClient(model=sd_turbo)
91
  PT = AsyncInferenceClient(model=proteus)
92
  LLM = AsyncInferenceClient(model="openchat/openchat-3.5-0106")
93
  RF = AsyncInferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
 
145
  print("Disconnected, Clone status:", clone)
146
 
147
  setupCommand = """
148
+ ## Command: `--setup`
149
 
150
+ The `--setup` command enables Lyre to communicate within a designated channel.
151
 
152
  ## Usage:
153
  ```css
 
171
 
172
  """
173
 
174
+ revokeCommand = """
175
+ ## Command: `--revoke`
176
+
177
+ The `--revoke` command prevents Lyre from communicating within a designated channel.
178
+
179
+ ## Usage:
180
+ ```css
181
+ --setup [channel]
182
+ ```
183
+
184
+ ## Parameters
185
+ - **[channel]**: Specify the target channel where you want the bot to be active. This is the channel name.
186
+
187
+ ## Example
188
+
189
+ ```arduino
190
+ --setup <#1234567890123456789>
191
+ ```
192
+
193
+ or
194
+
195
+ ```arduino
196
+ --setup #general
197
+ ```"""
198
+
199
  @client.event
200
  async def on_message(message):
201
  msgchannel = message.channel
 
401
  e = await message.reply(embed=embed)
402
  if imgp != "":
403
  np = """lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature"""
404
+ image = await SDXL.text_to_image(imgp, negative_prompt=np)
405
  image.save("image.png")
406
  embed.set_footer(
407
  text=