Spaces:
Running
Running
Update knowledgeassistant/components/summarization.py
Browse files
knowledgeassistant/components/summarization.py
CHANGED
@@ -19,13 +19,9 @@ class DataSummarization:
|
|
19 |
try:
|
20 |
pipe = pipeline("summarization", model="/app/models/bart-large-cnn")
|
21 |
logging.info("Summarization Pipeline Successfully Setup")
|
22 |
-
|
23 |
text = read_txt_file(input_text_path)
|
24 |
-
print(f"Input Text: {text[:500]}")
|
25 |
summary = pipe(text, min_length = min_length, do_sample = False)
|
26 |
-
print(f"Summary Output: {summary}")
|
27 |
logging.info("Text successfully summarized")
|
28 |
-
|
29 |
write_txt_file(self.data_summarization_config.summarized_text_file_path, summary[0].get("summary_text"))
|
30 |
logging.info("Successfully wrote summarized text")
|
31 |
except Exception as e:
|
|
|
19 |
try:
|
20 |
pipe = pipeline("summarization", model="/app/models/bart-large-cnn")
|
21 |
logging.info("Summarization Pipeline Successfully Setup")
|
|
|
22 |
text = read_txt_file(input_text_path)
|
|
|
23 |
summary = pipe(text, min_length = min_length, do_sample = False)
|
|
|
24 |
logging.info("Text successfully summarized")
|
|
|
25 |
write_txt_file(self.data_summarization_config.summarized_text_file_path, summary[0].get("summary_text"))
|
26 |
logging.info("Successfully wrote summarized text")
|
27 |
except Exception as e:
|