Skip to content

Commit

Permalink
Improve Readme: shorter intro, VLMs, MCP, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric-roucher committed Jan 31, 2025
1 parent 93c433c commit 8ba9338
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ We've created [`CodeAgent`](https://huggingface.co/docs/smolagents/reference/age

This comparison shows that open-source models can now take on the best closed models!

<details>

## Contributing
<summary><h2>Contributing</h2></summary>

To contribute, follow our [contribution guide](https://github.com/huggingface/smolagents/blob/main/CONTRIBUTING.md).

Expand Down Expand Up @@ -158,6 +159,7 @@ To run tests locally, run this command:
```bash
make test
```
</details>

## Citing smolagents

Expand Down
10 changes: 8 additions & 2 deletions src/smolagents/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,21 @@ def parse_code_blobs(code_blob: str) -> str:
if "final" in code_blob and "answer" in code_blob:
raise ValueError(
f"""
The code blob is invalid, because the regex pattern {pattern} was not found in {code_blob=}. It seems like you're trying to return the final answer, you can do it as follows:
Your code snippet is invalid, because the regex pattern {pattern} was not found in it.
Here is your code snippet:
{code_blob}
It seems like you're trying to return the final answer, you can do it as follows:
Code:
```py
final_answer("YOUR FINAL ANSWER HERE")
```<end_code>""".strip()
)
raise ValueError(
f"""
The code blob is invalid, because the regex pattern {pattern} was not found in {code_blob=}. Make sure to include code with the correct pattern, for instance:
Your code snippet is invalid, because the regex pattern {pattern} was not found in it.
Here is your code snippet:
{code_blob}
Make sure to include code with the correct pattern, for instance:
Thoughts: Your thoughts
Code:
```py
Expand Down

0 comments on commit 8ba9338

Please sign in to comment.