However, when you create an App with gradio, Hugging Face Spaces says that the gradio package comes pre-installed at version 2.2.6. I think this text needs an update. (cc @sgugger)
Sorry about that! Weâre fixing the bug but for now you can install a specific version of Gradio by adding lines like this at the top of your app.py file:
import os
os.system("pip uninstall -y gradio")
os.system("pip install gradio==2.6.4")
While sdk_version can be used to specify an official version, can I use my own fork? In fact the version had been specified in the requirements.txt, I just want to suppress RUN pip install --no-cache-dir gradio==3.24.1 which canceled my installation.
SDK gradio installation is after the requirements.txt installation so it doesnât work. As I donât figure out how to install pnpm, my current hack is to upload a zip file gradio.zip containing the working directory of my fork, then extract and install it in the app.py, which looks like this:
Hi @radames was there any progress on changing the requirements installation order? (i.e. controlling when requirements.txt is called with reference to the final system pip install - ââ> RUN pip install --no-cache-dir streamlit==1.28.2 âuvicorn>=0.14.0â spaces==0.18.0â). Iâm aware this can be done by running os.system(âpip install âŚâ), but this seems cumbersome.
I am facing an issue now with my apps that run on haystack, since the upgrade to spaces==0.18.0 (as this version requires pydantic==2.5.1)
hi @mtyrrell the Docker file for our predefined SDKs (Gradio/Streamlit) are a bit inflexible. However we now offer a pre-requirements.txt not sure if that would helpful. Another alternative is to use a custom Dockerfile, here is a Gradio example Dockerfile ¡ SpacesExamples/Gradio-Docker-Template at main
On another note, you can always specify a custom gradio package on the requirements.txt have you tried that?
When I tried that after setting up Docker I got this error:
Did you install Gradio from source files? You need to build the frontend by running /scripts/build_frontend.sh
As I donât figure out how to install pnpm , my current hack is to upload a zip file gradio.zip containing the working directory of my fork, then extract and install it in the app.py , which looks like this
When I tried this I got this error:
file:///home/user/app/_gradio does not appear to be a Python project: neither âsetup.pyâ nor âpyproject.tomlâ found.
I havenât found a way to use a gradio fork in huggingface spaces.
Thank you, but none of those versions work for me, as all the versions from 3.16.0 suffer from this bug:
Breaking my spaces.
Version 3.15.0 used to work, see this space built with it:
If you duplicate it, fetching models takes so long it goes over the 30 minutes limit and it wonât build.
I havenât been able to update that space since January 25 because of this, and I need a custom gradio solution that is 3.15.0 but with gr.load implemented.
But it seems not possible, killing the space.
Update 2024/3/26: Everything working fine currently and I didnât need to upgrade Gradio, yay!