First clone or download the huggingface repository. Change the model name as per need.
from huggingface_hub import snapshot_download
model_name = "Qwen/Qwen2.5-0.5B-Instruct"
snapshot_download(repo_id=model_name, local_dir="./hf_model")
Save the above code in model_downloader.py
. Then run the above code with
python model_downloader.py