Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ model = AutoModelForCausalLM.from_pretrained("KoboldAI/OPT-2.7B-Nerybus-Mix")
|
|
9 |
def chat(Prompt):
|
10 |
|
11 |
input_ids = tokenizer(Prompt, return_tensors="pt").input_ids
|
12 |
-
generated_ids = model.generate(input_ids, max_length=256, repetition_penalty = 2.5, top_k = 75, eos_token_id=tokenizer.eos_token_id)
|
13 |
bot = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
|
14 |
return bot
|
15 |
|
|
|
9 |
def chat(Prompt):
|
10 |
|
11 |
input_ids = tokenizer(Prompt, return_tensors="pt").input_ids
|
12 |
+
generated_ids = model.generate(input_ids, use_cache=True, max_length=256, repetition_penalty = 2.5, top_k = 75, eos_token_id=tokenizer.eos_token_id)
|
13 |
bot = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
|
14 |
return bot
|
15 |
|