mirror of
https://github.com/wassname/vllm.git
synced 2026-09-10 12:41:29 +08:00
[Core] Support offline use of local cache for models (#4374)
Signed-off-by: Prashant Gupta <prashantgupta@us.ibm.com> Co-authored-by: Travis Johnson <tjohnson31415@gmail.com>
This commit is contained in:
co-authored by
Travis Johnson
parent
81661da7b2
commit
d6e520e170
@@ -5,6 +5,7 @@ import os
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict, Generator, List, Optional, Tuple, Type
|
||||
|
||||
import huggingface_hub
|
||||
import torch
|
||||
from torch import nn
|
||||
|
||||
@@ -131,7 +132,9 @@ class DefaultModelLoader(BaseModelLoader):
|
||||
model_path = snapshot_download(
|
||||
model_id=model,
|
||||
cache_dir=self.load_config.download_dir,
|
||||
revision=revision)
|
||||
local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
|
||||
revision=revision,
|
||||
)
|
||||
else:
|
||||
model_path = model
|
||||
return model_path
|
||||
|
||||
Reference in New Issue
Block a user