Run this model with HF Jobs
Run aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 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/aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1. 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/aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 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 aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Download handler.py from aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1/resolve/main/handler.py
- Command line
-
hf download hf://aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1/handler.py
-
curl -L -o handler.py https://huggingface.co/aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1/resolve/main/handler.py
1.2 kB
| from typing import Dict, List, Any | |
| from unsloth import FastLanguageModel | |
| class EndpointHandler(): | |
| def __init__(self, path=""): | |
| # Preload all the elements you are going to need at inference. | |
| # pseudo: | |
| # self.model= load_model(path) | |
| model, tokenizer = FastLanguageModel.from_pretrained( | |
| model_name = "aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1", | |
| max_seq_length = 2048, | |
| dtype = "float16", | |
| load_in_4bit = True, | |
| ) | |
| FastLanguageModel.for_inference(model) | |
| self.model = model | |
| self.tokenizer = tokenizer | |
| def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]: | |
| """ | |
| data args: | |
| inputs (:obj: `str` | `PIL.Image` | `np.array`) | |
| kwargs | |
| Return: | |
| A :obj:`list` | `dict`: will be serialized and returned | |
| """ | |
| input_ids = self.tokenizer.encode(data["inputs"], return_tensors = "pt").to("cuda") | |
| output = self.model.generate(input_ids, max_new_tokens = 128, pad_token_id = self.tokenizer.eos_token_id) | |
| return [{"output": self.tokenizer.decode(output[0], skip_special_tokens = True)}] | |