Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintao-Huang committed Oct 25, 2024
1 parent bd535c2 commit b0dc74c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions swift/llm/utils/argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import math
import os
import platform
import accelerate
import sys
from dataclasses import dataclass, field
from typing import Any, Dict, List, Literal, Optional, Set, Tuple, Union

import accelerate
import json
import numpy as np
import torch
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def _init_training_args(self) -> None:
metric_for_best_model = 'rouge-l' if self.predict_with_generate else 'loss'
if hasattr(self, 'rlhf_type') and self.rlhf_type == 'ppo':
metric_for_best_model = None

if version.parse('1.0') <= version.parse(accelerate.__version__) < version.parse('1.1'):
self.dataset_seed = None

Expand Down
10 changes: 6 additions & 4 deletions swift/llm/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,12 @@ def get_model_tokenizer_from_repo(model_dir: str,
with context:
model = automodel_class.from_pretrained(
model_dir, config=model_config, torch_dtype=torch_dtype, trust_remote_code=True, **model_kwargs)

# fix not save modeling_xxx.py (transformers 4.45)
# https://github.com/huggingface/transformers/issues/24737
has_remote_code = hasattr(model_config, 'auto_map') and automodel_class.__name__ in model_config.auto_map
if has_remote_code and model._auto_class is None:
model._auto_class = automodel_class.__name__
model.is_gptq = is_gptq
model.is_awq = is_awq
model.is_aqlm = is_aqlm
Expand Down Expand Up @@ -7180,10 +7186,6 @@ def get_additional_saved_files(model_type: str) -> List[str]:
'qwen-vl': ['SimSun.ttf'],
'qwen-audio': ['mel_filters.npz'],
'yi-vl': ['vit'],
'minicpm-v-v2_6-chat': ['modeling_navit_siglip.py'],
'molmoe': ['modeling_molmoe.py'],
'molmo': ['modeling_molmo.py'],
'emu3-chat': ['modeling_emu3.py']
}
for key, files_list in files_mapping.items():
if key in model_type:
Expand Down

0 comments on commit b0dc74c

Please sign in to comment.