Instructions to use Synexian/Nexian-finetuned-llama3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Synexian/Nexian-finetuned-llama3 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-bnb-4bit") model = PeftModel.from_pretrained(base_model, "Synexian/Nexian-finetuned-llama3") - Transformers
How to use Synexian/Nexian-finetuned-llama3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Synexian/Nexian-finetuned-llama3")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Synexian/Nexian-finetuned-llama3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Synexian/Nexian-finetuned-llama3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Synexian/Nexian-finetuned-llama3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Synexian/Nexian-finetuned-llama3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Synexian/Nexian-finetuned-llama3
- SGLang
How to use Synexian/Nexian-finetuned-llama3 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Synexian/Nexian-finetuned-llama3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Synexian/Nexian-finetuned-llama3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Synexian/Nexian-finetuned-llama3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Synexian/Nexian-finetuned-llama3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use Synexian/Nexian-finetuned-llama3 with Docker Model Runner:
docker model run hf.co/Synexian/Nexian-finetuned-llama3
Model Card for outputs
This model is a fine-tuned version of unsloth/llama-3-8b-bnb-4bit. It has been trained using TRL.
Quick start
from transformers import pipeline, AutoTokenizer
MODEL_ID = "Synexian/Nexian-finetuned-llama3"
tok = AutoTokenizer.from_pretrained(MODEL_ID, use_fast=True)
pipe = pipeline(
"text-generation",
model=MODEL_ID,
tokenizer=tok,
torch_dtype="auto",
device_map="auto", # will use cuda:0 if available
)
def chat(user_text, system_text="You are a helpful, concise assistant.", **gen_kwargs):
messages = [
{"role": "system", "content": system_text},
{"role": "user", "content": user_text},
]
try:
prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
except Exception:
prompt = f"{system_text}\n\nUser: {user_text}\nAssistant:"
out = pipe(
prompt,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_p=0.9,
return_full_text=False,
eos_token_id=tok.eos_token_id,
pad_token_id=tok.eos_token_id,
**gen_kwargs
)[0]["generated_text"]
return out.strip()
if __name__ == "__main__":
print(chat("Summarize gradient descent in 5 bullet points."))
Training procedure
This model was trained with SFT.
Framework versions
- PEFT 0.17.0
- TRL: 0.21.0
- Transformers: 4.55.0
- Pytorch: 2.7.1+cu128
- Datasets: 3.6.0
- Tokenizers: 0.21.4
Citations
Cite TRL as:
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}
- Downloads last month
- 3
Model tree for Synexian/Nexian-finetuned-llama3
Base model
meta-llama/Meta-Llama-3-8B Quantized
unsloth/llama-3-8b-bnb-4bit