Skip to content

Commit e8128a3

Browse files
authored
chore(scripts): handle summarization errors (#4271)
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 369110e commit e8128a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/model_gallery_info.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ def format_description(description):
103103
if readmeFile:
104104
# If there is a README file, read it
105105
readme = fs.read_text(readmeFile)
106-
summarized_readme = summarize(readme)
106+
try:
107+
summarized_readme = summarize(readme)
108+
except Exception as e:
109+
print(f"Error summarizing the README: {str(e)}", file=sys.stderr)
107110
summarized_readme = format_description(summarized_readme)
108111

109112
print("Model correctly processed")

0 commit comments

Comments
 (0)