Run this model with HF Jobs
Run OFA-Sys/ofa-huge 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/OFA-Sys/ofa-huge. 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/OFA-Sys/ofa-huge 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.
Instructions to use OFA-Sys/ofa-huge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OFA-Sys/ofa-huge with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OFA-Sys/ofa-huge", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
e8ba032
1
Parent(s): 2a4f282
Update README.md
Browse filesreformat code of generator
40 unmodified lines414243444546474840 unmodified lines>>> # using the generator of fairseq version>>> model = OFAModel.from_pretrained(ckpt_dir, use_cache=True)>>> generator = sequence_generator.SequenceGenerator(tokenizer=tokenizer,beam_size=5, max_len_b=16,min_len=0, no_repeat_ngram_size=3) # using the generator of fairseq version>>> data = {}>>> data["net_input"] = {"input_ids": inputs, 'patch_images': patch_img, 'patch_masks':torch.tensor([True])}>>> gen_output = generator.generate([model], data)40 unmodified lines4142434445464748495051525340 unmodified lines>>> # using the generator of fairseq version>>> model = OFAModel.from_pretrained(ckpt_dir, use_cache=True)>>> generator = sequence_generator.SequenceGenerator(tokenizer=tokenizer,beam_size=5,max_len_b=16,min_len=0,no_repeat_ngram_size=3,)>>> data = {}>>> data["net_input"] = {"input_ids": inputs, 'patch_images': patch_img, 'patch_masks':torch.tensor([True])}>>> gen_output = generator.generate([model], data)
README.md+7-2