moondream icon indicating copy to clipboard operation
moondream copied to clipboard

Model Download path

Open RYG81 opened this issue 1 year ago • 7 comments

I try to run a gradio app, and it starts downloading models at first run. Unfortunately, I have lake of space on my C drive. Is there a way to define a location for model download?

Thanks in advance

RYG81 avatar Jan 31 '24 12:01 RYG81

If you are using Windows, the following bat script may meet your needs. ` @echo off

set HF_HOME=huggingface

call venv\Scripts\activate # Your virtual environment activation script python gradio_demo.py

pause ` In this way, the model file will be located in the huggingface folder in the project directory.

SleeeepyZhou avatar Jan 31 '24 12:01 SleeeepyZhou

Where I put this? I am a little noob in programming yet.

RYG81 avatar Jan 31 '24 12:01 RYG81

Have you created a virtual environment?

SleeeepyZhou avatar Jan 31 '24 13:01 SleeeepyZhou

Yes I made environment, and installed all requirement.txt dependencies.

RYG81 avatar Jan 31 '24 14:01 RYG81

You can search for activate.bat, or if you are creating a virtual environment by Conda, you need to find the Python location of the virtual environment and see what kind of virtual environment you have. Then you also need to see how your virtual environment path works. The situation is quite complicated, and I'm not sure about you either. Of course, if you know how to activate a virtual environment, then write down the command you activated so that I can understand better. You can refer to the following code

@echo off set HF_HOME=huggingface # This will set your model path call venv\Scripts\activate # Your virtual environment activation script python gradio_demo.py # Start the gradio script pause

SleeeepyZhou avatar Feb 01 '24 05:02 SleeeepyZhou

to create venv I used - python -m venv venv to activate venv i just type venv\scipts\activate to deactivae - deactivate

so where should i add above?

RYG81 avatar Feb 01 '24 09:02 RYG81

You can start directly using this script in my fork.

SleeeepyZhou avatar Feb 02 '24 02:02 SleeeepyZhou