I have copied to my space to try the AI agent but I encounter the below problems. Please help to solve this. Thanks.
===== Application Startup at 2025-03-03 02:06:07 =====
tool.py: 0%| | 0.00/635 [00:00<?, ?B/s]
tool.py: 100%|██████████| 635/635 [00:00<00:00, 3.62MB/s]
- Running on local URL: http://0.0.0.0:7860, with SSR
(experimental, to disable set
ssr=False
inlaunch()
)
/usr/local/lib/python3.10/site-packages/gradio/blocks.py:2680: UserWarning: Setting share=True is not supported on Hugging Face Spaces
warnings.warn(
To create a public link, set share=True
in launch()
.
╭────────────────────────────────── New run ───────────────────────────────────╮
│ │
│ hello │
│ │
╰─ HfApiModel - Qwen/Qwen2.5-Coder-32B-Instruct ───────────────────────────────╯
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
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-67c5103a-73922cc22c6652503fd16939;f22c21f3-384d-4e88-970f-fe21266989e4)
Invalid username or password.
[Step 0: Duration 0.03 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 2088, in process_api
result = await self.call_function(
File “/usr/local/lib/python3.10/site-packages/gradio/blocks.py”, line 1647, in call_function
prediction = await utils.async_iteration(iterator)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 728, in async_iteration
return await anext(iterator)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 722, 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 2461, in run_sync_in_worker_thread
return await future
File “/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py”, line 962, in run
result = context.run(func, *args)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 705, in run_sync_iterator_async
return next(iterator)
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 866, 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’