PhantHive commited on
Commit
a6a2fe3
·
verified ·
1 Parent(s): 98e2a1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -25,10 +25,8 @@ def greet(text):
25
  batch = tokenizer(f"\"{text}\" ->: ", return_tensors='pt')
26
 
27
  # Use torch.no_grad to disable gradient calculation
28
- with torch
29
- .no_grad():
30
- output_tokens = model.generate(**batch, do_sample=True, max_new_tokens=15
31
- )
32
 
33
  return tokenizer.decode(output_tokens[0], skip_special_tokens=True)
34
 
 
25
  batch = tokenizer(f"\"{text}\" ->: ", return_tensors='pt')
26
 
27
  # Use torch.no_grad to disable gradient calculation
28
+ with torch.no_grad():
29
+ output_tokens = model.generate(**batch, do_sample=True, max_new_tokens=15)
 
 
30
 
31
  return tokenizer.decode(output_tokens[0], skip_special_tokens=True)
32