Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tastelikefeet committed Jul 8, 2024
1 parent 7562138 commit be9253a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions swift/llm/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5271,12 +5271,13 @@ def get_model_tokenizer_llava(model_dir: str,
**kwargs):
llm_model_type = kwargs.pop('llm_model_type')
if 'local_repo_path' in kwargs:
repo_path = kwargs['local_repo_path']
local_repo_path = kwargs['local_repo_path']
elif 'next' in llm_model_type:
repo_path = 'https://github.com/LLaVA-VL/LLaVA-NeXT'
local_repo_path = _git_clone_github(repo_path)
else:
repo_path = 'https://github.com/haotian-liu/LLaVA'
local_repo_path = _git_clone_github(repo_path)
local_repo_path = _git_clone_github(repo_path)
sys.path.append(os.path.join(local_repo_path))

if llm_model_type == 'mistral':
Expand Down
3 changes: 2 additions & 1 deletion swift/llm/utils/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _reduce_columns(cls: type) -> type:
cls._patching = True

def new_call_func(self, dataset: HfDataset) -> HfDataset:
self.column_state = set()
self.column_state = set(['images', 'videos', 'audios'])
dataset = call_func(self, dataset)
for k in dataset.features.keys():
if k not in self.column_state:
Expand Down Expand Up @@ -240,6 +240,7 @@ def preprocess(self, d: Dict[str, Any]) -> Dict[str, Any]:
hr.append([q[self.from_key], r[self.from_key]])
query = conversations[-2][self.value_key]
query_role = conversations[-2][self.from_key]
query_role = query_role if query_role == 'tool' else 'user'
response = conversations[-1][self.value_key]
system = sys
history = h
Expand Down

0 comments on commit be9253a

Please sign in to comment.