Spaces Gradio app - Build error: ValueError: Cannot queue with encryption or authentication enabled

Hi!

I created a fully working local Gradio app with authentication, using environmental variables for the API keys from OpenAI GPT-3. Once I replicate the app in the Spaces, the app build returns error:
“ValueError: Cannot queue with encryption or authentication enabled.” The app runs fine, if I remove the authentication from the launch-method.

My app uses a login function to pass in the launch-method: “launch(auth=login)” and it works perfectly in my local Gradio app, but not in the Spaces. I know the environmental variables are passed correctly from Spaces settings, as the API works fine without the authentication.

Is there a way to overcome this issue with the authentication?

I understand the Spaces is meant for open collaboration, so I tend to understand the authentication is less relevant. However, I wonder if there is anyway of implementing user authentication, since it is a working feature in the Gradio.

The main point for me is to know, if user authentication is possible / works in Spaces, so I could implement this “best practices” from OpenAI API.

Thanks,

1 Like

Hey there! You can set enable_queue=False to disable the queue. It’s enabled by default in Spaces, which would explain why this issue is popping up in Spaces but not locally.

cc @abidlabs @freddyaboulton

@osanseviero I set enable_queue=False and it did load the log in interface. But its not logging in with the right credentials. It just keeps reloading the log in interface when I sign in correctly. And when I sign in incorrectly, interface will say incorrect credentials. Know how to fix this?

@Teemu did you face this problem also?

I don’t get this issue when launching locally. Anyone can help on what’s happening with Spaces?

Hi @kenndanielso ! Sorry for the trouble. I think the problem is with hugging face spaces and not your particular demo. Will take a look this week.

1 Like