Run this model with HF Jobs
Run peterjandre/codet5-vbnet-csharp 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/peterjandre/codet5-vbnet-csharp. 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/peterjandre/codet5-vbnet-csharp 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 peterjandre/codet5-vbnet-csharp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use peterjandre/codet5-vbnet-csharp with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("peterjandre/codet5-vbnet-csharp") model = AutoModelForSeq2SeqLM.from_pretrained("peterjandre/codet5-vbnet-csharp", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download handler.py from peterjandre/codet5-vbnet-csharp: direct link, hf CLI and curl.
- Browser
- Download file 672 Bytes
-
https://huggingface.co/peterjandre/codet5-vbnet-csharp/resolve/main/handler.py
- Command line
-
hf download hf://peterjandre/codet5-vbnet-csharp/handler.py
-
curl -L -o handler.py https://huggingface.co/peterjandre/codet5-vbnet-csharp/resolve/main/handler.py
672 Bytes
| from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline | |
| # Global variables to cache model and tokenizer | |
| model = None | |
| tokenizer = None | |
| nlp = None | |
| def init(): | |
| global model, tokenizer, nlp | |
| model_name_or_path = "." | |
| model = AutoModelForSeq2SeqLM.from_pretrained(model_name_or_path) | |
| tokenizer = AutoTokenizer.from_pretrained(model_name_or_path) | |
| nlp = pipeline("text2text-generation", model=model, tokenizer=tokenizer) | |
| def inference(payload): | |
| inputs = payload.get("inputs", "") | |
| if not inputs: | |
| return {"error": "No inputs provided"} | |
| # Run generation pipeline | |
| outputs = nlp(inputs, max_length=256) | |
| return outputs | |