Балаганский Никита Николаевич commited on
Commit
e94abdd
1 Parent(s): aee37f1
Files changed (2) hide show
  1. app.py +1 -1
  2. generator.py +2 -2
app.py CHANGED
@@ -196,7 +196,7 @@ def load_sampler(cls_model_name, lm_tokenizer):
196
  return sampler
197
 
198
 
199
- @st.cache
200
  def inference(
201
  lm_model_name: str,
202
  cls_model_name: str,
 
196
  return sampler
197
 
198
 
199
+ @st.cache(suppress_st_warning=True)
200
  def inference(
201
  lm_model_name: str,
202
  cls_model_name: str,
generator.py CHANGED
@@ -44,7 +44,7 @@ class Generator:
44
  caif_period: int,
45
  caif_tokens_num: Union[int, None] = None,
46
  entropy: float = None,
47
- progress_bar = None,
48
  **sampler_kwargs
49
  ):
50
  self.entropy = entropy
@@ -66,7 +66,7 @@ class Generator:
66
  caif_tokens_num=caif_tokens_num,
67
  **sampler_kwargs
68
  )
69
- progress_bar.step((i+1)/max_length)
70
  if ended_sequences.all():
71
  break
72
 
 
44
  caif_period: int,
45
  caif_tokens_num: Union[int, None] = None,
46
  entropy: float = None,
47
+ progress_bar=None,
48
  **sampler_kwargs
49
  ):
50
  self.entropy = entropy
 
66
  caif_tokens_num=caif_tokens_num,
67
  **sampler_kwargs
68
  )
69
+ progress_bar.progress((i+1)/max_length)
70
  if ended_sequences.all():
71
  break
72