Dependency Conflict with huggingface-hub Version in Gradio and Llama-Index Setup
Certainly! Here’s a detailed message to explain the dependency issue you’re facing, with the necessary commands to help resolve it. Hopefully, this will make it clear to others in the community what you’ve tried and where the issue lies.Help Request: Dependency Conflict Between Gradio and Huggingface Hub VersionsHi everyone,I’ve been struggling with a dependency issue for an entire day and am hoping someone here can help. My application requires specific versions of libraries, especiallyhuggingface-hub==0.23.5andgradio==4.44.0, but a later step in my setup process unintentionally upgradeshuggingface-hub, causing conflicts. Here’s a breakdown of what I’ve tried and where the problem occurs:Setup and ContextInstalling dependencies:First, I install all my dependencies from arequirements.txtfile:pip install -r requirements.txtIn this file, I specify:huggingface-hub==0.23.5
gradio==4.44.0Final setup step:After installing dependencies, I run the following:RUN pip install --no-cache-dir gradio[oauth]==5.5.0 "uvicorn>=0.14.0" spacesThis command unexpectedlyupgradeshuggingface-hubto version0.26.2, which is incompatible with somellama-indexpackages I’m using:llama-index-llms-huggingfacerequireshuggingface-hub<0.24.0llama-index-llms-huggingface-apialso requireshuggingface-hub<0.24.0ProblemThe version bump ofhuggingface-hubto0.26.2breaks compatibility with thesellama-indexpackages, causing my application to fail.Attempted Solutions and Issue RecurrenceI tried downgradinghuggingface-hubback to0.23.5after the initial install, but each time I execute the final setup step (above), the newer version0.26.2ofhuggingface-hubis reinstalled due togradio==5.5.0dependencies.Request for HelpI would greatly appreciate any guidance on:How to forcepipto retainhuggingface-hub==0.23.5while still satisfyinggradiorequirements, ORAny alternative approach that ensures stable compatibility across these packages without further dependency conflicts.Thank you for any insights—this has been a full day of troubleshooting without resolution, and I’m feeling stuck.
2024-11-08T03:00:34Z
For Gradio, huggingface_hub is an important part of the backend. If you use a different version, there is a high possibility that it will not work properly.If possible, the most reliable thing to do is to downgrade Gradio.If you absolutely have to use 5.5.0, you will have to do something about Lllamaindex.RUN pip install --no-cache-dir gradio[oauth]==4.44.0 "uvicorn>=0.14.0" spaces
2024-11-08T04:09:03Z
Thank you for the response!I understand thathuggingface_hubis crucial for Gradio’s backend compatibility. I can try downgrading Gradio if that’s likely to be more stable. However, I’m not sure how to apply these changes directly on the Hugging Face Spaces server. Could you guide me on how to run the downgrading commands (or any necessary adjustments) directly in Spaces?To give some more context, I’m usinghuggingface_hubprimarily for LLM models, which means downgrading it could impact compatibility withllama-index, as it currently doesn’t support the latesthuggingface_hubversions.Any advice on managing this setup would be much appreciated—thanks again!
2024-11-08T04:18:05Z
I looked at your space, and the cause is probably in README.md, which I think you can fix. README.md is a configuration file in HF.There is a bigger problem, though. You have set the token as an environment variable, which is completely visible to others. I recommend that you set it as a secret.huggingface.coSpaces OverviewWe’re on a journey to advance and democratize artificial intelligence through open source and open science.Edit:I opened PR for README.md.
2024-11-08T05:37:34Z
Thanks for yourcontributing.
2024-11-08T17:38:25Z
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.