lunarflu HF Staff commited on
Commit
f82ba90
·
1 Parent(s): 58c201b

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (4) hide show
  1. app.py +1 -0
  2. deepfloydif.py +5 -1
  3. falcon.py +5 -1
  4. musicgen.py +5 -1
app.py CHANGED
@@ -9,6 +9,7 @@ from discord.ext import commands
9
  from falcon import continue_falcon, try_falcon
10
  from musicgen import music_create
11
 
 
12
  # HF GUILD SETTINGS
13
  MY_GUILD_ID = 1077674588122648679 if os.getenv("TEST_ENV", False) else 879548962464493619
14
  MY_GUILD = discord.Object(id=MY_GUILD_ID)
 
9
  from falcon import continue_falcon, try_falcon
10
  from musicgen import music_create
11
 
12
+
13
  # HF GUILD SETTINGS
14
  MY_GUILD_ID = 1077674588122648679 if os.getenv("TEST_ENV", False) else 879548962464493619
15
  MY_GUILD = discord.Object(id=MY_GUILD_ID)
deepfloydif.py CHANGED
@@ -97,7 +97,11 @@ async def deepfloydif_stage_1(ctx, prompt, client):
97
  print("Safety checks passed for deepfloydif_stage_1")
98
  # interaction.response message can't be used to create a thread, so we create another message
99
  message = await ctx.send(f"**{prompt}** - {ctx.author.mention}")
100
- thread = await message.create_thread(name=f"{prompt}", auto_archive_duration=60)
 
 
 
 
101
  await thread.send(
102
  "[DISCLAIMER: HuggingBot is a **highly experimental** beta feature; Additional information on the"
103
  " DeepfloydIF model can be found here: https://huggingface.co/spaces/DeepFloyd/IF"
 
97
  print("Safety checks passed for deepfloydif_stage_1")
98
  # interaction.response message can't be used to create a thread, so we create another message
99
  message = await ctx.send(f"**{prompt}** - {ctx.author.mention}")
100
+ if len(prompt) > 99:
101
+ small_prompt = prompt[:99]
102
+ else:
103
+ small_prompt = prompt
104
+ thread = await message.create_thread(name=f"{small_prompt}", auto_archive_duration=60)
105
  await thread.send(
106
  "[DISCLAIMER: HuggingBot is a **highly experimental** beta feature; Additional information on the"
107
  " DeepfloydIF model can be found here: https://huggingface.co/spaces/DeepFloyd/IF"
falcon.py CHANGED
@@ -68,7 +68,11 @@ async def try_falcon(ctx, prompt):
68
  if os.environ.get("TEST_ENV") == "True":
69
  print("Safetychecks passed for try_falcon")
70
  message = await ctx.send(f"**{prompt}** - {ctx.author.mention}")
71
- thread = await message.create_thread(name=prompt, auto_archive_duration=60) # interaction.user
 
 
 
 
72
  await thread.send(
73
  "[DISCLAIMER: HuggingBot is a **highly experimental** beta feature; The Falcon model and system"
74
  " prompt can be found here: https://huggingface.co/spaces/HuggingFaceH4/falcon-chat]"
 
68
  if os.environ.get("TEST_ENV") == "True":
69
  print("Safetychecks passed for try_falcon")
70
  message = await ctx.send(f"**{prompt}** - {ctx.author.mention}")
71
+ if len(prompt) > 99:
72
+ small_prompt = prompt[:99]
73
+ else:
74
+ small_prompt = prompt
75
+ thread = await message.create_thread(name=small_prompt, auto_archive_duration=60) # interaction.user
76
  await thread.send(
77
  "[DISCLAIMER: HuggingBot is a **highly experimental** beta feature; The Falcon model and system"
78
  " prompt can be found here: https://huggingface.co/spaces/HuggingFaceH4/falcon-chat]"
musicgen.py CHANGED
@@ -34,7 +34,11 @@ async def music_create(ctx, prompt):
34
  print("Safetychecks passed for music_create")
35
 
36
  message = await ctx.send(f"**{prompt}** - {ctx.author.mention}")
37
- thread = await message.create_thread(name=prompt, auto_archive_duration=60)
 
 
 
 
38
 
39
  await thread.send(
40
  "[DISCLAIMER: HuggingBot is a beta feature; The MusicGen"
 
34
  print("Safetychecks passed for music_create")
35
 
36
  message = await ctx.send(f"**{prompt}** - {ctx.author.mention}")
37
+ if len(prompt) > 99:
38
+ small_prompt = prompt[:99]
39
+ else:
40
+ small_prompt = prompt
41
+ thread = await message.create_thread(name=small_prompt, auto_archive_duration=60)
42
 
43
  await thread.send(
44
  "[DISCLAIMER: HuggingBot is a beta feature; The MusicGen"