Instructions to use erythropygia/LLAMA3-8B-Turkish-4bit-Quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erythropygia/LLAMA3-8B-Turkish-4bit-Quantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erythropygia/LLAMA3-8B-Turkish-4bit-Quantized")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("erythropygia/LLAMA3-8B-Turkish-4bit-Quantized") model = AutoModelForCausalLM.from_pretrained("erythropygia/LLAMA3-8B-Turkish-4bit-Quantized") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use erythropygia/LLAMA3-8B-Turkish-4bit-Quantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erythropygia/LLAMA3-8B-Turkish-4bit-Quantized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erythropygia/LLAMA3-8B-Turkish-4bit-Quantized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/erythropygia/LLAMA3-8B-Turkish-4bit-Quantized
- SGLang
How to use erythropygia/LLAMA3-8B-Turkish-4bit-Quantized 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 "erythropygia/LLAMA3-8B-Turkish-4bit-Quantized" \ --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": "erythropygia/LLAMA3-8B-Turkish-4bit-Quantized", "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 "erythropygia/LLAMA3-8B-Turkish-4bit-Quantized" \ --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": "erythropygia/LLAMA3-8B-Turkish-4bit-Quantized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use erythropygia/LLAMA3-8B-Turkish-4bit-Quantized 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 erythropygia/LLAMA3-8B-Turkish-4bit-Quantized 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 erythropygia/LLAMA3-8B-Turkish-4bit-Quantized to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for erythropygia/LLAMA3-8B-Turkish-4bit-Quantized to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="erythropygia/LLAMA3-8B-Turkish-4bit-Quantized", max_seq_length=2048, ) - Docker Model Runner
How to use erythropygia/LLAMA3-8B-Turkish-4bit-Quantized with Docker Model Runner:
docker model run hf.co/erythropygia/LLAMA3-8B-Turkish-4bit-Quantized
Model Card: Custom LLaMA-3 Model with 4-bit Quantization
Model Details
- Architecture: LoRA (Low-Rank Adaptation)
- Quantization: 4-bit
Model Description
This is a custom version of the LLaMA-3 language model trained with 4-bit quantization. The model uses LoRA (Low-Rank Adaptation) for efficient fine-tuning, allowing for reduced memory usage and faster training times without significant loss in performance.
Training Configuration
The model was trained using the following configuration:
- Learning Rate: 2e-4
- Optimizer: AdamW (8-bit)
- Weight Decay: 0.01
- LR Scheduler: Linear
- Mixed Precision: FP16/BF16 (depending on hardware support)
LoRA Configuration
The model uses LoRA for efficient parameter adaptation with the following settings:
- Rank (r): 16
- Target Modules:
["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"] - LoRA Alpha: 16
Training Dataset
- Dataset: Custom dataset containing Turkish text data
- Max Sequence Length: 1024
Usage
To use this model, you can load it using the Hugging Face transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("erythropygia/LLAMA3-8B-Turkish-4bit-Quantized")
model = AutoModelForCausalLM.from_pretrained("erythropygia/LLAMA3-8B-Turkish-4bit-Quantized", low_cpu_mem_usage=True, load_in_4bit=True)
prompt_format = """Aşağıda bir görevi tanımlayan bir talimat ve daha fazla bağlam sağlayan bir girdi bulunmaktadır. Talebi uygun şekilde tamamlayan bir yanıt yazın.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
inputs = tokenizer(
[
prompt_format.format(
""", # instruction
"", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 512, do_sample=True, temperature=0.75, top_k=50, top_p=0.9, repetition_penalty=1.1)
Performance
- Training Loss:: 1.385300
- Evaluation Metrics: To be updated based on evaluation results
- Limitations and Biases: This model inherits biases present in the training data. It is important to evaluate the model thoroughly for your specific use case and consider any ethical implications of its deployment.
- Downloads last month
- 4