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