Use authentication in huggingface Gradio API!(hosting on ZeroGPU)

Guys.

I have already hosted my code on ZeroGPU(for that i subscribe the PRO)

When I visited him on the webpage (logged in as my PRO user), I did receive 5x usage quota compared to free users.

But when I use it in Python code, I use the gradio_client, and I can indeed post requests to the Gradio API that I host on HF Space using ZeroGPU.I found that my quota is when I am not logged in.

By the way, why i know the quota is when i am not logged in?

I do some test, finally i get some information:

NOT LOGIN: the quota is about 180s
LOGIN: the quota is 300s
PRO USER: the quota is 1500s…

So i just want find some way to solve this problem, i want use my PRO user in my code!!!

I have tried carrying HF tokens or headers (including cookies), but they have not worked and I am still logged in.

The error just like:
gradio_client.exceptions.AppError: The upstream Gradio app has raised an exception: You have exceeded your GPU quota (150s requested vs. 149s left). <a style="white-space: nowrap;text-underline-offset: 2px;color: var(--body-text-color)" href="https://huggingface.co/join">Create a free account</a> to get more usage quota.

2 Likes

Did you ever resolve this? I am also using a ZeroGPU space via API and would like my Pro quota to be applied. I occasionally get an error prompting me to create a free account – so evidently even though I’m supplying my hf_token to the gradio client, it is not recognising me as logged in.

2 Likes

If you have any bugs or suggestions regarding Zero GPU space, you can send them to the author using the following.

Edit:
Perhaps related?