mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-09-20 03:52:49 +08:00
Compare commits
2 Commits
d8e4482849
...
b2395b25b0
Author | SHA1 | Date | |
---|---|---|---|
|
b2395b25b0 | ||
|
df364998b1 |
@ -19,6 +19,7 @@ sentencepiece
|
||||
tiktoken
|
||||
modelscope>=1.14.0
|
||||
hf-transfer
|
||||
safetensors<=0.5.3
|
||||
# python
|
||||
fire
|
||||
omegaconf
|
||||
|
@ -35,7 +35,7 @@ class DataArguments:
|
||||
default=None,
|
||||
metadata={"help": "The name of dataset(s) to use for evaluation. Use commas to separate multiple datasets."},
|
||||
)
|
||||
dataset_dir: Union[str, dict] = field(
|
||||
dataset_dir: str = field(
|
||||
default="data",
|
||||
metadata={"help": "Path to the folder containing the datasets."},
|
||||
)
|
||||
|
@ -73,7 +73,7 @@ def fix_valuehead_checkpoint(
|
||||
if safe_serialization:
|
||||
path_to_checkpoint = os.path.join(output_dir, SAFE_WEIGHTS_NAME)
|
||||
with safe_open(path_to_checkpoint, framework="pt", device="cpu") as f:
|
||||
state_dict: dict[str, torch.Tensor] = {key: f.get_tensor(key) for key in f.keys()}
|
||||
state_dict: dict[str, torch.Tensor] = {key: f.get_tensor(key).clone() for key in f.keys()}
|
||||
else:
|
||||
path_to_checkpoint = os.path.join(output_dir, WEIGHTS_NAME)
|
||||
state_dict: dict[str, torch.Tensor] = torch.load(path_to_checkpoint, map_location="cpu", weights_only=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user