Radosław Wolnik commited on
Commit
958222e
·
1 Parent(s): 4fca44d
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -36,8 +36,8 @@ async def on_message(message):
36
  previous_messages = ("\n".join(messages))
37
  response = generate(previous_messages, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0)
38
 
39
- part = split_string(response)
40
- for part in part:
41
  await channel.send(part)
42
 
43
  message_counts[message.channel.id] = 0 # Reset the counter
@@ -46,6 +46,7 @@ async def on_message(message):
46
 
47
  def split_string(text: str) -> list[str]:
48
  """Helper function to split text into chunks"""
 
49
  return [text[i:i+3900] for i in range(0, len(text), 3900)]
50
 
51
  def generate(
 
36
  previous_messages = ("\n".join(messages))
37
  response = generate(previous_messages, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0)
38
 
39
+ splited_response = split_string(response)
40
+ for part in splited_response:
41
  await channel.send(part)
42
 
43
  message_counts[message.channel.id] = 0 # Reset the counter
 
46
 
47
  def split_string(text: str) -> list[str]:
48
  """Helper function to split text into chunks"""
49
+
50
  return [text[i:i+3900] for i in range(0, len(text), 3900)]
51
 
52
  def generate(