Open ElianoMarques opened 3 months ago
Thank you for reporting this issue @ElianoMarques.
For a better understanding, please note that during export your model will be copied to another temporary directory, which explains the different name you see in the logs.
I failed to reproduce the issue using the following code snippet:
from tempfile import TemporaryDirectory
from transformers import AutoModelForCausalLM
from optimum.neuron import NeuronModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("gpt2")
with TemporaryDirectory() as tmpdir:
model.save_pretrained(tmpdir)
neuron_model = NeuronModelForCausalLM.from_pretrained(tmpdir, export=True)
print(neuron_model.config.neuron)
Can you verify if that corresponds to your sequence of calls ?
Also, can you check:
System Info
Who can help?
@JingyaHuang
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction (minimal, reproducible, runnable)
Hi, I have the following model fine-tuned on Llama3 8b stored in a local directory.
I'm trying to "export" the model so it can be used with inferentia 2 and I get a weird error that it can't find safetensors in a temp folder that is not the ones i'm adding to the function NeuronModelForCausalLM.
code:
error:
this is running in a container with an instance type inf2 8x.
Is this something you can help understanding what is happening? where is this /tmp/tmpa9lp6hci coming from?
Thank you for your help, Eliano
Expected behavior
The function should just work as expected.