Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ def generate_text(system_prompt, user_prompt, temperature, max_length, min_lengt
|
|
10 |
{"role": "system", "content": system_prompt},
|
11 |
{"role": "user", "content": user_prompt},
|
12 |
]
|
13 |
-
tokenized_chat = tokenizer.apply_chat_template(messages, tokenize=
|
14 |
|
15 |
inputs = tokenizer(tokenized_chat, return_tensors="pt").to(model.device)
|
16 |
|
@@ -37,4 +37,4 @@ iface = gr.Interface(
|
|
37 |
live=False,
|
38 |
)
|
39 |
|
40 |
-
iface.launch()
|
|
|
10 |
{"role": "system", "content": system_prompt},
|
11 |
{"role": "user", "content": user_prompt},
|
12 |
]
|
13 |
+
tokenized_chat = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
14 |
|
15 |
inputs = tokenizer(tokenized_chat, return_tensors="pt").to(model.device)
|
16 |
|
|
|
37 |
live=False,
|
38 |
)
|
39 |
|
40 |
+
iface.launch()
|