Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ model = AutoModelForCausalLM.from_pretrained("Norod78/hebrew-gpt_neo-xl", pad_to
|
|
8 |
model.to(device)
|
9 |
|
10 |
def chat(message, history=[]):
|
11 |
-
new_user_input_ids = tokenizer.encode(
|
12 |
if len(history) > 0:
|
13 |
last_set_of_ids = history[len(history)-1][2]
|
14 |
bot_input_ids = torch.cat([last_set_of_ids, new_user_input_ids], dim=-1)
|
|
|
8 |
model.to(device)
|
9 |
|
10 |
def chat(message, history=[]):
|
11 |
+
new_user_input_ids = tokenizer.encode(tokenizer.eos_token + message, return_tensors='pt')
|
12 |
if len(history) > 0:
|
13 |
last_set_of_ids = history[len(history)-1][2]
|
14 |
bot_input_ids = torch.cat([last_set_of_ids, new_user_input_ids], dim=-1)
|