Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ with open("dialogues.txt", "r", encoding="utf-8") as file:
|
|
14 |
# Функция генерации ответа
|
15 |
def generate(prompt, _=None):
|
16 |
random_phrase = random.choice(random_phrases)
|
17 |
-
user_input = f"[USER]: {prompt}\n[BOT]: "
|
18 |
inputs = tokenizer.encode(user_input, return_tensors="pt")
|
19 |
outputs = model.generate(inputs, max_length=25, num_return_sequences=1, pad_token_id=tokenizer.eos_token_id)
|
20 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
14 |
# Функция генерации ответа
|
15 |
def generate(prompt, _=None):
|
16 |
random_phrase = random.choice(random_phrases)
|
17 |
+
user_input = f"[USER]: {prompt}\n[BOT]: {random_phrase}"
|
18 |
inputs = tokenizer.encode(user_input, return_tensors="pt")
|
19 |
outputs = model.generate(inputs, max_length=25, num_return_sequences=1, pad_token_id=tokenizer.eos_token_id)
|
20 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|