Spaces:
Runtime error
Runtime error
updated
Browse files
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 |
-
|
|
|
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")
|