Run this model with HF Jobs

Run microsoft/phi-2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/microsoft/phi-2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/microsoft/phi-2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/microsoft/phi-2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/microsoft/phi-2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Cannot load the model PhiForSequenceClassificationModified(basemodel.config)

#80
by lyliiiii - opened

when i am loading the following code:model = PhiForSequenceClassificationModified(basemodel.config),
there's an error: AttributeError: 'PhiForCausalLM' object has no attribute 'transformer'.
I successfully run this code before, but for this time there's an error.
Thanks for anyone who can help!!

Microsoft org

Hello @lyliiiii !

You are using a custom implemented class of PhiForSequenceClassificationModified. Please check https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi/modeling_phi.py for updating your modeling file.

Also, ensure to use use trust_remote_code=True if below transformers==4.37.0.

Regards,
Gustavo.

gugarosa changed discussion status to closed

Thanks gugarosa.
I checked for the trust_remote_code=True, and my version of transformer can only updated with the latest 4.36.2
(ERROR: No matching distribution found for transformers==4.37.0)
And i am fine-tuning using colab. How can i fix this?
Thank you!

same issue,
if use self.model = basemodel.model will cause error:
RuntimeError: A view was created in no_grad mode and is being modified inplace with grad mode enabled. This view was created inside a custom Function (or because an input was returned as-is) and the autograd logic to handle view+inplace would override the custom backward associated with the custom Function, leading to incorrect gradients. This behavior is forbidden. You can fix this by cloning the output of the custom Function.

lyliiiii changed discussion status to open

Sign up or log in to comment

⌂ 换网址