microsoft / microsoft/TransformerCompression

Loading models is not easy with `from_pretrained`

Open
#188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
460
Forks
58
Avg merge
8h 40m
Merged PRs (30d)
1

Description

Hi team,

First off, thanks for the excellent repo and great work.

I was able to slice a model but when I am trying to load it using AutoModelForCausalLM.from_pretrained(), I am getting the following error

OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory /xxx/TransformerCompression/experiments/llama_7b_0.25.

I've checked all the issues mentioned but am unable to find a proper fix. Please guide as it will be super helpful :)

Something like the below would be helpful as the other codebases just load the model using AutoModelForCausalLM.from_pretrained() and it's not feasible to modify all the other codebases :(

Image

Looking forward

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining how sliced models are saved and how the resulting directory is passed to AutoModelForCausalLM.from_pretrained(). Reproduce the missing-model-file error with the directory described in the issue, then verify that a sliced model can be loaded through the standard from_pretrained() call without modifying downstream code.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.