chore(scripts): handle summarization errors (#4271)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-11-26 14:51:55 +01:00 committed by GitHub
parent 369110e6bf
commit e8128a339a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,7 +103,10 @@ if __name__ == "__main__":
if readmeFile: if readmeFile:
# If there is a README file, read it # If there is a README file, read it
readme = fs.read_text(readmeFile) 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) summarized_readme = format_description(summarized_readme)
print("Model correctly processed") print("Model correctly processed")