Could not locate the configuration_RW.py inside tiiuae/falcon-7b-instruct.
Hi All.
I am getting the following Could not locate the configuration_RW.py inside tiiuae/falcon-7b-instruct. error since this morning. From my understanding it is related to the following change to the Falcon model.
Usecase
I have fine tuned the falcon-7b-instruct model using SFT and use the following snippet to load the model:
sft_model_16 = AutoModelForCausalLM.from_pretrained(
model_dir,
device_map="auto",
trust_remote_code=True,
torch_dtype=torch.float16,
)
The model_dir
includes the base model along with the adaptor.
I am using 4.27.4
of the transformers library. Prior to the latest commit, the instantiated model was of the RWForCausalLM
type.
RWForCausalLM(
(transformer): RWModel(
(word_embeddings): Embedding(65024, 4544)
(h): ModuleList(
(0-31): 32 x DecoderLayer(
(input_layernorm): LayerNorm((4544,), eps=1e-05, elementwise_affine=True)
(self_attention): Attention(
(maybe_rotary): RotaryEmbedding()
(query_key_value): Linear(in_features=4544, out_features=4672, bias=False)
(dense): Linear(in_features=4544, out_features=4544, bias=False)
(attention_dropout): Dropout(p=0.0, inplace=False)
)
(mlp): MLP(
(dense_h_to_4h): Linear(in_features=4544, out_features=18176, bias=False)
(act): GELU(approximate='none')
(dense_4h_to_h): Linear(in_features=18176, out_features=4544, bias=False)
)
)
)
(ln_f): LayerNorm((4544,), eps=1e-05, elementwise_affine=True)
)
(lm_head): Linear(in_features=4544, out_features=65024, bias=False)
)
After the latest commit, the instantiated model was of the FalconForCausalLM
type.
FalconForCausalLM(
(transformer): FalconModel(
(word_embeddings): Embedding(65024, 4544)
(h): ModuleList(
(0-31): 32 x FalconDecoderLayer(
(self_attention): FalconAttention(
(maybe_rotary): FalconRotaryEmbedding()
(query_key_value): FalconLinear(in_features=4544, out_features=4672, bias=False)
(dense): FalconLinear(in_features=4544, out_features=4544, bias=False)
(attention_dropout): Dropout(p=0.0, inplace=False)
)
(mlp): FalconMLP(
(dense_h_to_4h): FalconLinear(in_features=4544, out_features=18176, bias=False)
(act): GELU(approximate='none')
(dense_4h_to_h): FalconLinear(in_features=18176, out_features=4544, bias=False)
)
(input_layernorm): LayerNorm((4544,), eps=1e-05, elementwise_affine=True)
)
)
(ln_f): LayerNorm((4544,), eps=1e-05, elementwise_affine=True)
)
(lm_head): Linear(in_features=4544, out_features=65024, bias=False)
)
What is the recommended way to resolve this error and safe guarding against this scenario in the future?
Thanks in advance.
Same issue for me.
it seems that the Falcon team has modified the code and removed the configuration_RW.py file
Same issue. Welp!
Using FalconForCasualLm seems to be the solution https://huggingface.co/tiiuae/falcon-7b/discussions/60#651988650e3a5553d4aac013