Instructions to use inetnuc/llama-3-8b-chat-nuclear with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inetnuc/llama-3-8b-chat-nuclear with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inetnuc/llama-3-8b-chat-nuclear") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("inetnuc/llama-3-8b-chat-nuclear") model = AutoModelForCausalLM.from_pretrained("inetnuc/llama-3-8b-chat-nuclear") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use inetnuc/llama-3-8b-chat-nuclear with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inetnuc/llama-3-8b-chat-nuclear" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inetnuc/llama-3-8b-chat-nuclear", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inetnuc/llama-3-8b-chat-nuclear
- SGLang
How to use inetnuc/llama-3-8b-chat-nuclear 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 "inetnuc/llama-3-8b-chat-nuclear" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inetnuc/llama-3-8b-chat-nuclear", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "inetnuc/llama-3-8b-chat-nuclear" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inetnuc/llama-3-8b-chat-nuclear", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use inetnuc/llama-3-8b-chat-nuclear 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 inetnuc/llama-3-8b-chat-nuclear 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 inetnuc/llama-3-8b-chat-nuclear to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for inetnuc/llama-3-8b-chat-nuclear to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="inetnuc/llama-3-8b-chat-nuclear", max_seq_length=2048, ) - Docker Model Runner
How to use inetnuc/llama-3-8b-chat-nuclear with Docker Model Runner:
docker model run hf.co/inetnuc/llama-3-8b-chat-nuclear
LLAMA-3 8B Chat Nuclear Model
- Developed by: inetnuc
- License: apache-2.0
- Finetuned from model: unsloth/llama-3-8b-bnb-4bit
This LLAMA-3 model was finetuned to enhance capabilities in text generation for nuclear-related topics. The training was accelerated using Unsloth and Huggingface's TRL library, achieving a 2x faster performance.
Finetuning Process
The model was finetuned using the Unsloth library, leveraging its efficient training capabilities. The process included the following steps:
- Data Preparation: Loaded and preprocessed nuclear-related data.
- Model Loading: Utilized
unsloth/llama-3-8b-bnb-4bitas the base model. - LoRA Patching: Applied LoRA (Low-Rank Adaptation) for efficient training.
- Training: Finetuned the model using Hugging Face's TRL library with optimized hyperparameters.
Model Details
- Base Model:
unsloth/llama-3-8b-bnb-4bit - Language: English (
en) - License: Apache-2.0
Files and Versions
| File Name | Description |
|---|---|
| .gitattributes | Initial commit |
| README.md | Model description and usage |
| adapter_config.json | Configuration for adapter |
| adapter_model.safetensors | Finetuned model weights |
| config.json | Configuration for base model |
| generation_config.json | Generation configuration for model |
| model-00001-of-00007.safetensors | Part of the base model weights |
| model-00002-of-00007.safetensors | Part of the base model weights |
| model-00003-of-00007.safetensors | Part of the base model weights |
| model-00004-of-00007.safetensors | Part of the base model weights |
| model-00005-of-00007.safetensors | Part of the base model weights |
| model-00006-of-00007.safetensors | Part of the base model weights |
| model-00007-of-00007.safetensors | Part of the base model weights |
| model.safetensors.index.json | Index for the model weights |
| special_tokens_map.json | Special tokens mapping |
| tokenizer.json | Tokenizer data |
| tokenizer_config.json | Configuration for tokenizer |
Model Card Authors
MUSTAFA UMUT OZBEK
Contact
https://www.linkedin.com/in/mustafaumutozbek/ https://x.com/m_umut_ozbek
Usage
Loading the Model
You can load the model and tokenizer using the following code snippet:
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("inetnuc/llama-3-8b-chat-nuclear")
model = AutoModelForCausalLM.from_pretrained("inetnuc/llama-3-8b-chat-nuclear")
# Example of generating text
inputs = tokenizer("what is the iaea approach for cyber security?", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 30
Model tree for inetnuc/llama-3-8b-chat-nuclear
Base model
meta-llama/Meta-Llama-3-8B