Run this model with HF Jobs
Run ammarnasr/codegen-350M-mono-ruby 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/ammarnasr/codegen-350M-mono-ruby. 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/ammarnasr/codegen-350M-mono-ruby 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/ammarnasr/codegen-350M-mono-ruby. 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/ammarnasr/codegen-350M-mono-ruby. 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.
Instructions to use ammarnasr/codegen-350M-mono-ruby with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Adapters
How to use ammarnasr/codegen-350M-mono-ruby with Adapters:
from adapters import AutoAdapterModel model = AutoAdapterModel.from_pretrained("<base-model-id>") model.load_adapter("ammarnasr/codegen-350M-mono-ruby", set_active=True) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files37 unmodified lines3839404142434445464748495037 unmodified lines```pythonfrom transformers import AutoTokenizer, AutoModelForCausalLMtokenizer = AutoTokenizer.from_pretrained("ammmarnasr/codegen-350M-mono-ruby")model = AutoModelForCausalLM.from_pretrained("Salesforce/codegen-350M-mono")text = "def hello_world():"input_ids = tokenizer(text, return_tensors="pt").input_idsgenerated_ids = model.generate(input_ids, max_length=128)print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))```37 unmodified lines383940414243444546474849505152535455565758596037 unmodified lines```pythonfrom transformers import AutoTokenizer, AutoModelForCausalLMfrom peft import PeftConfig, PeftModelmodel_name = "ammarnasr/codegen-350M-mono-ruby"peft_config = PeftConfig.from_pretrained(model_name)tokenizer = AutoTokenizer.from_pretrained(peft_config.base_model_name_or_path)model = AutoModelForCausalLM.from_pretrained(peft_config.base_model_name_or_path)model = PeftModel.from_pretrained(model, model_name)model.print_trainable_parameters()text = "def hello_world"input_ids = tokenizer.encode(text, return_tensors="pt")generated_ids = model.generate(input_ids=input_ids, max_length=100)print('Generated: \n')print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))```
README.md+15-5