An issue in code_agents.ipynb

#116
by WilliamRabuel - opened

During the process of deploying an agent to a Hugging Face Space using push_to_hub, several issues were identified and addressed. Initially, a UnicodeEncodeError occurred because the huggingface_hub library's write_text function did not specify UTF-8 encoding, failing on emojis in the auto-generated README.md. Once fixed, the generated app.py script crashed due to a SyntaxError, as it incorrectly used the reserved keyword class as a variable name. Furthermore, the deployed Space consistently installed an outdated version of smolagents (1.19.0) due to a stale build cache on the platform, which led to a jinja2.UndefinedError because the code_block_opening_tag variable was missing; the solution was to force an update to version 1.20.0 or higher in the requirements. Finally, the example notebook required modifications, as the push_to_hub and from_hub commands were hardcoded and needed to be commented out for general use. I have submitted several pull requests to both the smolagents and huggingface_hub libraries to resolve these bugs, though I was unable to directly suggest edits to the notebook file due to repository permissions.

Sign up or log in to comment