Run this model with HF Jobs

Run google/mt5-small 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 to fine-tune https://huggingface.co/google/mt5-small. 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/google/mt5-small 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.

wrong output?

#4
by szhf - opened

I ran the example codes:

from transformers import AutoTokenizer, MT5ForConditionalGeneration
tokenizer = AutoTokenizer.from_pretrained("mt5-small")
model = MT5ForConditionalGeneration.from_pretrained("mt5-small")

training

input_ids = tokenizer("The walks in park", return_tensors="pt").input_ids
labels = tokenizer(" cute dog the ", return_tensors="pt").input_ids
outputs = model(input_ids=input_ids, labels=labels)
loss = outputs.loss
logits = outputs.logits

inference

input_ids = tokenizer(
"summarize: studies have shown that owning a dog is good for you", return_tensors="pt"
).input_ids # Batch size 1
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# studies have shown that owning a dog is good for you.

But got something like this:

Is this an expected outcome?

I can't see the result you got.
And I got "401 Client Error: Unauthorized for url: https://huggingface.co/mt5-small/resolve/main/config.json" error when import pretrained model.

Sign up or log in to comment