uhygfd commited on
Commit
48beffb
1 Parent(s): 6f1dcb6

Update app.py

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