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:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio new
How to use aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="aidando73/llama-3.3-70b-instruct-code-agent-fine-tune-v1", max_seq_length=2048, )
File size: 1,196 Bytes
f028aae | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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)}]
|