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