Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ attention_mask = {'pad_token_id':1,
|
|
8 |
'eos_token_id':0}
|
9 |
|
10 |
def chat(Prompt):
|
11 |
-
|
12 |
-
generated_ids = model.generate(
|
13 |
bot = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
|
14 |
return bot
|
15 |
|
|
|
8 |
'eos_token_id':0}
|
9 |
|
10 |
def chat(Prompt):
|
11 |
+
input_ids = tokenizer(Prompt, return_tensors="pt").input_ids
|
12 |
+
generated_ids = model.generate(input_ids, max_length=128)
|
13 |
bot = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
|
14 |
return bot
|
15 |
|