vilarin commited on
Commit
997f90e
1 Parent(s): 1ae0340

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -7,8 +7,6 @@ import os
7
  import time
8
 
9
 
10
-
11
-
12
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
13
  MODEL_ID = "CohereForAI/aya-23-8B"
14
  MODEL_NAME = MODEL_ID.split("/")[-1]
@@ -74,7 +72,11 @@ def stream_chat(message: str, history: list, temperature: float, max_new_tokens:
74
  temperature=temperature,
75
  )
76
 
77
- gen_text = tokenizer.decode(gen_tokens[0])
 
 
 
 
78
 
79
  return gen_text
80
 
 
7
  import time
8
 
9
 
 
 
10
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
11
  MODEL_ID = "CohereForAI/aya-23-8B"
12
  MODEL_NAME = MODEL_ID.split("/")[-1]
 
72
  temperature=temperature,
73
  )
74
 
75
+ gen_tokens = [
76
+ gt[prompt_padded_len:] for gt in gen_tokens
77
+ ]
78
+
79
+ gen_text = tokenizer.batch_decode(gen_tokens, skip_special_tokens=True)
80
 
81
  return gen_text
82