-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gradio admin interface #732
Conversation
return f"❌ Unauthorized (user '{user['name']} is not a member of '{ADMIN_HF_ORGANIZATION}')" | ||
|
||
def view_jobs(token): | ||
global pending_jobs_df |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this will work for concurrent users if deployed on spaces. The same df will be shared by everyone.
Might be best to save this in an invisible gr.Dataframe
component? That will be isolated per session.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok if it's shared by everyone for now.
I tried to store it in a gr.Dataframe
though but it failed. The dataframe is 40MB and has string and timestamp types that can be null.
I can share you a pickle dump if you want to try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More specifically I tried to store the pandas dataframe it in a gr.Dataframe with visible=False, and it caused my server to hang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, it's super useful, thanks.
We can see later how to integrate it inside the deployment to get a published version.
@@ -0,0 +1,5 @@ | |||
gradio==~3.16.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have only one: pyproject.toml or requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added requirements.txt to easily deploy it on Spaces - I don't think Spaces support pyproject.toml files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
If needed, we could later generate the file automatically in the CI with https://python-poetry.org/docs/cli/#export, in order to avoid duplicating the dependencies information.
Merging for now, and later we can improve the dataframe thing and auto deployment if we want |
A simple Gradio app to show the pending jobs.
Contrary to the observable notebook, this can run locally and connect to your local dev environment.
I added a feature to see the number of jobs in the queue, and a simple SQL query feature that uses DuckDB.
The app can be extended to support more admin features e.g.
I'll also deploy it on Spaces