diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5ffd0f..e6cfb91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -91,8 +91,8 @@ happy to make the changes or help you make a contribution if you're interested! ## I want to become a maintainer of the project. How do I get there? -Smolagents is a project led and managed by Hugging Face as an initial fork of Transformers Agents. We are more than -happy to have motivated individuals from other organizations join us as maintainers with the goal of helping Smolagents +smolagents is a project led and managed by Hugging Face. We are more than +happy to have motivated individuals from other organizations join us as maintainers with the goal of helping smolagents make a dent in the world of Agents. If you are such an individual (or organization), please reach out to us and let's collaborate. \ No newline at end of file diff --git a/README.md b/README.md index 74a82b5..db3617f 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,18 @@ 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! +## Contributing + +To contribute, follow our [contribution guide](https://github.com/huggingface/smolagents/blob/main/CONTRIBUTING.md). + +At any moment, feel welcome to open an issue, citing your exact error traces and package versions if it's a bug. +It's often even better to open a PR with your proposed fixes/changes! + +To run tests locally, run this command: +```bash +pytest -sv . +``` + ## Citing smolagents If you use `smolagents` in your publication, please cite it by using the following BibTeX entry. diff --git a/docs/source/zh/tutorials/tools.md b/docs/source/zh/tutorials/tools.md index 216d93b..44541c7 100644 --- a/docs/source/zh/tutorials/tools.md +++ b/docs/source/zh/tutorials/tools.md @@ -186,7 +186,7 @@ from smolagents import HfApiModel model = HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct") agent = CodeAgent(tools=[], model=model, add_base_tools=True) -agent.tools.append(model_download_tool) +agent.tools[model_download_tool.name] = model_download_tool ``` 现在我们可以利用新工具: diff --git a/src/smolagents/default_tools.py b/src/smolagents/default_tools.py index a6a7313..3a6be33 100644 --- a/src/smolagents/default_tools.py +++ b/src/smolagents/default_tools.py @@ -31,7 +31,6 @@ from .local_python_executor import ( ) from .tools import TOOL_CONFIG_FILE, PipelineTool, Tool from .types import AgentAudio -from .utils import truncate_content if is_torch_available(): from transformers.models.whisper import ( @@ -278,6 +277,7 @@ class VisitWebpageTool(Tool): import requests from markdownify import markdownify from requests.exceptions import RequestException + from smolagents.utils import truncate_content except ImportError: raise ImportError( "You must install packages `markdownify` and `requests` to run this tool: for instance run `pip install markdownify requests`." diff --git a/tests/test_all_docs.py b/tests/test_all_docs.py index 3ad901d..ae5e8cb 100644 --- a/tests/test_all_docs.py +++ b/tests/test_all_docs.py @@ -115,6 +115,7 @@ class TestDocs: "while llm_should_continue(memory):", # This is pseudo code "ollama_chat/llama3.2", # Exclude ollama building in guided tour "model = TransformersModel(model_id=model_id)", # Exclude testing with transformers model + "SmolagentsInstrumentor", # Exclude telemetry since it needs additional installs ] code_blocks = [ block