charanhu commited on
Commit
dd8ff4d
·
1 Parent(s): c056a0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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=True, add_generation_prompt=True, return_tensors="pt")
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()