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

#129
by Nerva1228 - opened

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). Create a free account to get more usage quota.

It's not the crux of this issue, but if the durarion designation exceeds 120 seconds, it's basically buggy.

It's not the crux of this issue, but if the durarion designation exceeds 120 seconds, it's basically buggy.

NO, I just do a test to find the quota.
Actually, the duration maybe 5~10s

Actually, the duration maybe 5~10s

Oh. If so, it's definitely a bug. ๐Ÿ˜…
I'm also using Zero GPU space, and sometimes the login quota doesn't work properly.
However, in my case, for some reason it's a different pattern from yours, and the login status doesn't work properly in the web browser. If I sign in explicitly using the OAuth sign-in button on the space, it works.
I've never used the Gradio Client...

Sign up or log in to comment