Hi, i started experimenting with the new transformers agents tools released yesterday.
from huggingface_hub import login
from transformers import HfAgent
from get_crypto_price import get_crypto_price
# Login to the Hugging Face Hub
login("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")
tool = get_crypto_price()
# tool.push_to_hub('get_crypto_price_tool')
# Create an agent
agent = HfAgent(
"https://api-inference.huggingface.co/models/bigcode/starcoder", additional_tools=[tool])
agent.run("whats the price of ethereum?", remote=True)
Made a quick custom tool to get crypto prices which works, but if i uncomment line 9 it won’t upload to HF. I get this error:
Traceback (most recent call last):
File "/home/chadb0t/Dev/anaconda/envs/hfagent/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 259, in hf_raise_for_status
response.raise_for_status()
File "/home/chadb0t/Dev/anaconda/envs/hfagent/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/chadb0t/Dev/anaconda/envs/hfagent/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2185, in create_repo
hf_raise_for_status(r)
File "/home/chadb0t/Dev/anaconda/envs/hfagent/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status
raise HfHubHTTPError(str(e), response=response) from e
huggingface_hub.utils._errors.HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create (Request ID: Root=1-645eaae1-7515c2161ab0362548afac8e)
You don't have the rights to create a space under this namespace
The docs just say to call tool.push_to_hub() without any further instruction. Not sure why i’m getting the 403