mistralai / mistral-finetune

Apache License 2.0
2.68k stars 220 forks source link

Use huggingface model ID instead of local path to model #27

Open DavidFarago opened 4 months ago

DavidFarago commented 4 months ago

The yaml attribute model_id_or_path suggested one can use a HF model ID, however this leads to the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/workspace/mistral-finetune/train.py", line 323, in <module>
    fire.Fire(train)
  File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 143, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 477, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 693, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/workspace/mistral-finetune/train.py", line 65, in train
    _train(args, exit_stack)
  File "/workspace/mistral-finetune/train.py", line 131, in _train
    raise ValueError(
ValueError: Invalid folder path. Please set `args.initial_model` to a valid folder path.

It seems load_model from wrapped_model.py would need a rather large overhaul to accept HF model IDs. Is this planned in the near future?