mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 06:12:50 +08:00
bugs fixed
Former-commit-id: 843b5d85e98b312e5d41ce62ec10e199011beb8c
This commit is contained in:
parent
e8e98bb125
commit
5a3280ebee
@ -98,12 +98,11 @@ def get_dataset_list(dataset_names: Optional[Sequence[str]], dataset_dir: str) -
|
||||
dataset_list: List["DatasetAttr"] = []
|
||||
for name in dataset_names:
|
||||
if dataset_info is None: # dataset_dir is ONLINE
|
||||
load_from = None
|
||||
if use_openmind():
|
||||
load_from = "om_hub"
|
||||
if use_modelscope():
|
||||
elif use_modelscope():
|
||||
load_from = "ms_hub"
|
||||
if load_from is None:
|
||||
else:
|
||||
load_from = "hf_hub"
|
||||
dataset_attr = DatasetAttr(load_from, dataset_name=name)
|
||||
dataset_list.append(dataset_attr)
|
||||
@ -117,9 +116,9 @@ def get_dataset_list(dataset_names: Optional[Sequence[str]], dataset_dir: str) -
|
||||
has_ms_url = "ms_hub_url" in dataset_info[name]
|
||||
|
||||
if has_om_url or has_hf_url or has_ms_url:
|
||||
if (use_openmind() and has_om_url) or (not has_hf_url):
|
||||
if has_om_url and (use_openmind() or not has_hf_url):
|
||||
dataset_attr = DatasetAttr("om_hub", dataset_name=dataset_info[name]["om_hub_url"])
|
||||
elif (use_modelscope() and has_ms_url) or (not has_hf_url):
|
||||
if has_ms_url and (use_modelscope() or not has_hf_url):
|
||||
dataset_attr = DatasetAttr("ms_hub", dataset_name=dataset_info[name]["ms_hub_url"])
|
||||
else:
|
||||
dataset_attr = DatasetAttr("hf_hub", dataset_name=dataset_info[name]["hf_hub_url"])
|
||||
|
@ -237,11 +237,9 @@ def try_download_model_from_other_hub(model_args: "ModelArguments") -> str:
|
||||
|
||||
if use_openmind():
|
||||
try:
|
||||
import openmind
|
||||
from openmind.utils.hub import snapshot_download
|
||||
|
||||
revision = "main" if model_args.model_revision == "main" else model_args.model_revision
|
||||
return snapshot_download(model_args.model_name_or_path, revision=revision, cache_dir=model_args.cache_dir)
|
||||
return snapshot_download(model_args.model_name_or_path, revision=model_args.model_revision, cache_dir=model_args.cache_dir)
|
||||
except ImportError:
|
||||
raise ImportError("Please install openmind and openmind_hub via `pip install openmind -U`")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user