Балаганский Никита Николаевич commited on
Commit
e15d353
1 Parent(s): b5251fc
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -129,6 +129,7 @@ def inference(
129
  target_label_id: int = 0,
130
  entropy_threshold: float = 0
131
  ) -> str:
 
132
  generator = load_generator(lm_model_name=lm_model_name)
133
  lm_tokenizer = transformers.AutoTokenizer.from_pretrained(lm_model_name)
134
  if alpha != 0:
 
129
  target_label_id: int = 0,
130
  entropy_threshold: float = 0
131
  ) -> str:
132
+ torch.set_grad_enabled(False)
133
  generator = load_generator(lm_model_name=lm_model_name)
134
  lm_tokenizer = transformers.AutoTokenizer.from_pretrained(lm_model_name)
135
  if alpha != 0: