efederici commited on
Commit
a4a62dd
1 Parent(s): 7445a22
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -39,7 +39,8 @@ class TextSummarizer:
39
 
40
  def summarize(self, model_name, input_text, generate_kwargs) -> str:
41
  if not self.generator or self.model_loaded != model_name:
42
- self.load(model_name)
 
43
  return self.generator(
44
  input_text, return_tensors=False, return_text=True, **generate_kwargs
45
  )[0].get("generated_text")
 
39
 
40
  def summarize(self, model_name, input_text, generate_kwargs) -> str:
41
  if not self.generator or self.model_loaded != model_name:
42
+ with st.spinner("Downloading/loading model..."):
43
+ self.load(model_name)
44
  return self.generator(
45
  input_text, return_tensors=False, return_text=True, **generate_kwargs
46
  )[0].get("generated_text")