Hello, I am experimenting with the new Transformer Agents, and I wrote the following script, which I copied from an example:
# load tools
from transformers.tools import HfAgent
import textract
# load sample pdf document
text = textract.process("/content/sample_data/TechNation.pdf").decode("utf-8")
# create agent
agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder")
# instruct agent
agent.run("What is `text` about?", text=text)
But I get the following error when I run my script:
ValueError Traceback (most recent call last)
<ipython-input-25-9fe5f4eb9747> in <cell line: 2>()
1 # instruct agent
----> 2 agent.run("What is `text` about?", text=text)
1 frames
/usr/local/lib/python3.10/dist-packages/transformers/tools/agents.py in generate_one(self, prompt, stop)
486 return self._generate_one(prompt)
487 elif response.status_code != 200:
--> 488 raise ValueError(f"Error {response.status_code}: {response.json()}")
489
490 result = response.json()[0]["generated_text"]
ValueError: Error 400: {'error': 'Authorization header is correct, but the token seems invalid'}
Please, what can I do about it? Thanks!