From e8128a339a4f5534d3bd0efcf2b1202c3e927fa2 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 26 Nov 2024 14:51:55 +0100 Subject: [PATCH] chore(scripts): handle summarization errors (#4271) Signed-off-by: Ettore Di Giacinto --- scripts/model_gallery_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/model_gallery_info.py b/scripts/model_gallery_info.py index 7df53701..ee258037 100644 --- a/scripts/model_gallery_info.py +++ b/scripts/model_gallery_info.py @@ -103,7 +103,10 @@ if __name__ == "__main__": if readmeFile: # If there is a README file, read it readme = fs.read_text(readmeFile) - summarized_readme = summarize(readme) + try: + summarized_readme = summarize(readme) + except Exception as e: + print(f"Error summarizing the README: {str(e)}", file=sys.stderr) summarized_readme = format_description(summarized_readme) print("Model correctly processed")