Tonic commited on
Commit
dc45ebf
β€’
1 Parent(s): 58e5994

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -22,7 +22,7 @@ def generate_text(prompt, custom_prompt, temperature, max_length):
22
  structured_input = f"[[[Title]]]: {prompt}\n[[[Content]]]: {custom_prompt}"
23
  inputs = tokenizer(structured_input, return_tensors='pt').to('cuda')
24
  generated_ids = model.generate(**inputs, max_new_tokens=max_length, temperature=temperature, do_sample=True)
25
- generated_text = tokenizer.decode(generated_ids[0], skip_special_tokens=False).split(tokenizer.eos_token)[0])
26
  return generated_text
27
 
28
 
 
22
  structured_input = f"[[[Title]]]: {prompt}\n[[[Content]]]: {custom_prompt}"
23
  inputs = tokenizer(structured_input, return_tensors='pt').to('cuda')
24
  generated_ids = model.generate(**inputs, max_new_tokens=max_length, temperature=temperature, do_sample=True)
25
+ generated_text = tokenizer.decode(generated_ids[0], skip_special_tokens=False).split(tokenizer.eos_token)[0]
26
  return generated_text
27
 
28