Hi. I’m a total newbie trying to “create my first agent using smolagents” (unit 1 of the curse). I created my toll in the app.py file, and can’t try running it, because of this error. Since I’m connectd to HF and could run Llama before, I don’t know what I’m supposed to do. Thanks for any help !
Error in generating model output:
401 Client Error: Unauthorized for url:
https://router.huggingface.co/hf-inference/models/Qwen/Qwen2.5-Coder-32B-Instruc
t/v1/chat/completions (Request ID:
Root=1-680fe549-24961bec7aaaeab27c26e4e1;e83a37db-03d8-4209-aa1e-a71e4259acef)
Invalid username or password.
[Step 1: Duration 0.07 seconds]
Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/gradio/queueing.py”, line 715, in process_events
response = await route_utils.call_process_api(
File “/usr/local/lib/python3.10/site-packages/gradio/route_utils.py”, line 322, in call_process_api
output = await app.get_blocks().process_api(
File “/usr/local/lib/python3.10/site-packages/gradio/blocks.py”, line 2137, in process_api
result = await self.call_function(
File “/usr/local/lib/python3.10/site-packages/gradio/blocks.py”, line 1675, in call_function
prediction = await utils.async_iteration(iterator)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 735, in async_iteration
return await anext(iterator)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 729, in anext
return await anyio.to_thread.run_sync(
File “/usr/local/lib/python3.10/site-packages/anyio/to_thread.py”, line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File “/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py”, line 2470, in run_sync_in_worker_thread
return await future
File “/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py”, line 967, in run
result = context.run(func, *args)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 712, in run_sync_iterator_async
return next(iterator)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 873, in gen_wrapper
response = next(iterator)
File “/home/user/app/Gradio_UI.py”, line 197, in interact_with_agent
for msg in stream_to_gradio(self.agent, task=prompt, reset_agent_memory=False):
File “/home/user/app/Gradio_UI.py”, line 145, in stream_to_gradio
total_input_tokens += agent.model.last_input_token_count
TypeError: unsupported operand type(s) for +=: ‘int’ and ‘NoneType’