Instructions to use sixfingerdev/SixFinger-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use sixfingerdev/SixFinger-8B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/meta-llama-3.1-8b-bnb-4bit") model = PeftModel.from_pretrained(base_model, "sixfingerdev/SixFinger-8B") - Transformers
How to use sixfingerdev/SixFinger-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sixfingerdev/SixFinger-8B")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sixfingerdev/SixFinger-8B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sixfingerdev/SixFinger-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sixfingerdev/SixFinger-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sixfingerdev/SixFinger-8B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sixfingerdev/SixFinger-8B
- SGLang
How to use sixfingerdev/SixFinger-8B 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 "sixfingerdev/SixFinger-8B" \ --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": "sixfingerdev/SixFinger-8B", "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 "sixfingerdev/SixFinger-8B" \ --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": "sixfingerdev/SixFinger-8B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use sixfingerdev/SixFinger-8B with Docker Model Runner:
docker model run hf.co/sixfingerdev/SixFinger-8B
Clarify model limitations and fix usage instructions
Browse files
README.md
CHANGED
|
@@ -7,7 +7,7 @@ tags:
|
|
| 7 |
- lora
|
| 8 |
- sft
|
| 9 |
- transformers
|
| 10 |
-
-
|
| 11 |
- unsloth
|
| 12 |
license: apache-2.0
|
| 13 |
datasets:
|
|
@@ -15,108 +15,73 @@ datasets:
|
|
| 15 |
language:
|
| 16 |
- tr
|
| 17 |
- en
|
| 18 |
-
- zh
|
| 19 |
---
|
| 20 |
-
# SixFinger-8B Adapter for LLaMA 3.1 8B
|
| 21 |
|
| 22 |
-
|
| 23 |
-
The adapter allows fine-tuned responses on top of the base model **```unsloth/llama-3.1-8b-bnb-4bit```** without modifying the base weights.
|
| 24 |
|
| 25 |
-
--
|
| 26 |
|
| 27 |
-
##
|
| 28 |
|
| 29 |
-
|
| 30 |
-
-
|
| 31 |
-
|
| 32 |
-
-
|
| 33 |
-
-
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
## Installation
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
```!pip install transformers accelerate bitsandbytes peft```
|
| 42 |
-
|
| 43 |
-
Ensure you have a GPU with sufficient VRAM for 4-bit inference.
|
| 44 |
-
|
| 45 |
-
---
|
| 46 |
-
|
| 47 |
-
## Loading the Model
|
| 48 |
-
|
| 49 |
-
1. **Load the Base Model**
|
| 50 |
-
|
| 51 |
-
```from transformers import AutoTokenizer, AutoModelForCausalLM```
|
| 52 |
-
|
| 53 |
-
```base_model = AutoModelForCausalLM.from_pretrained(
|
| 54 |
-
"unsloth/llama-3.1-8b-bnb-4bit",
|
| 55 |
-
device_map="auto"
|
| 56 |
-
)
|
| 57 |
```
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
'from peft import PeftModel'
|
| 62 |
-
|
| 63 |
-
'model = PeftModel.from_pretrained('
|
| 64 |
-
' base_model,'
|
| 65 |
-
' "sixfingerdev/SixFinger-8B"'
|
| 66 |
-
')'
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
'tokenizer = AutoTokenizer.from_pretrained("unsloth/llama-3.1-8b-bnb-4bit")'
|
| 71 |
-
|
| 72 |
-
---
|
| 73 |
-
|
| 74 |
-
## Example Usage
|
| 75 |
-
|
| 76 |
-
Generate text using the adapter:
|
| 77 |
```python
|
| 78 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 79 |
-
from peft import PeftModel
|
| 80 |
import torch
|
|
|
|
|
|
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
"unsloth/llama-3.1-8b-bnb-4bit",
|
| 85 |
-
device_map="auto"
|
| 86 |
-
)
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
inputs
|
| 97 |
-
|
| 98 |
-
|
|
|
|
|
|
|
| 99 |
|
| 100 |
-
|
|
|
|
| 101 |
```
|
| 102 |
-
---
|
| 103 |
-
|
| 104 |
-
## Notes
|
| 105 |
|
| 106 |
-
|
| 107 |
-
- 4-bit quantization significantly reduces VRAM usage. Ensure your GPU supports **bitsandbytes 4-bit operations**.
|
| 108 |
-
- You can merge the adapter into the base model for easier deployment if needed.
|
| 109 |
|
| 110 |
-
|
| 111 |
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
-
|
| 115 |
-
- [Transformers 4-bit Quantization](https://huggingface.co/docs/transformers/main/en/main_classes/quantization)
|
| 116 |
-
|
| 117 |
-
---
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
-
|
| 122 |
-
Ensure compliance with the **base model license** (Meta’s LLaMA).
|
|
|
|
| 7 |
- lora
|
| 8 |
- sft
|
| 9 |
- transformers
|
| 10 |
+
- peft
|
| 11 |
- unsloth
|
| 12 |
license: apache-2.0
|
| 13 |
datasets:
|
|
|
|
| 15 |
language:
|
| 16 |
- tr
|
| 17 |
- en
|
|
|
|
| 18 |
---
|
|
|
|
| 19 |
|
| 20 |
+
# SixFinger-8B — Llama 3.1 8B LoRA adapter
|
|
|
|
| 21 |
|
| 22 |
+
**This repository contains a LoRA adapter, not a standalone 8B model.** To run it, you need the original Llama 3.1 8B base model and the PEFT library. This is an experimental Turkish-language fine-tuning project.
|
| 23 |
|
| 24 |
+
## What is included
|
| 25 |
|
| 26 |
+
| Item | Details |
|
| 27 |
+
| --- | --- |
|
| 28 |
+
| Base model | [unsloth/Meta-Llama-3.1-8B-bnb-4bit](https://huggingface.co/unsloth/Meta-Llama-3.1-8B-bnb-4bit) |
|
| 29 |
+
| Fine-tuning | LoRA / supervised fine-tuning |
|
| 30 |
+
| Base-model loading | 4-bit bitsandbytes checkpoint |
|
| 31 |
+
| Training dataset | [Turkish QA Multi-Dialog](https://huggingface.co/datasets/sixfingerdev/turkish-qa-multi-dialog-dataset) |
|
| 32 |
+
| Published weights | Adapter weights, **not** the full base model |
|
| 33 |
|
| 34 |
+
The base model identifier is taken from this repository's `adapter_config.json`.
|
| 35 |
|
| 36 |
## Installation
|
| 37 |
|
| 38 |
+
```bash
|
| 39 |
+
pip install -U transformers accelerate peft bitsandbytes torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
```
|
| 41 |
|
| 42 |
+
A compatible GPU and enough memory to load the quantized base model are required.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
+
## Loading and generating text
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
```python
|
|
|
|
|
|
|
| 47 |
import torch
|
| 48 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 49 |
+
from peft import PeftModel
|
| 50 |
|
| 51 |
+
base_id = "unsloth/meta-llama-3.1-8b-bnb-4bit"
|
| 52 |
+
adapter_id = "sixfingerdev/SixFinger-8B"
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
tokenizer = AutoTokenizer.from_pretrained(base_id)
|
| 55 |
+
base = AutoModelForCausalLM.from_pretrained(base_id, device_map="auto")
|
| 56 |
+
model = PeftModel.from_pretrained(base, adapter_id)
|
| 57 |
+
model.eval()
|
| 58 |
|
| 59 |
+
prompt = "Soru: Yapay zekâ nedir?\nCevap:"
|
| 60 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 61 |
|
| 62 |
+
with torch.inference_mode():
|
| 63 |
+
output_ids = model.generate(
|
| 64 |
+
**inputs,
|
| 65 |
+
max_new_tokens=128,
|
| 66 |
+
do_sample=False,
|
| 67 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 68 |
+
)
|
| 69 |
|
| 70 |
+
new_tokens = output_ids[0, inputs["input_ids"].shape[-1]:]
|
| 71 |
+
print(tokenizer.decode(new_tokens, skip_special_tokens=True))
|
| 72 |
```
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
+
This is a loading example, not a verified quality benchmark. Exact outputs depend on the prompt, decoding settings, and installed library versions.
|
|
|
|
|
|
|
| 75 |
|
| 76 |
+
## Evaluation and limitations
|
| 77 |
|
| 78 |
+
- **Experimental checkpoint:** no independently reproducible benchmark results have been published for this adapter.
|
| 79 |
+
- The repository is **not** an 8B model trained from scratch; its behavior depends on the upstream model.
|
| 80 |
+
- Generated information may be incorrect. Evaluate on your own use case before deployment.
|
| 81 |
+
- Data quality and provenance should be reviewed before production use.
|
| 82 |
|
| 83 |
+
## License and attribution
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
+
The adapter is published with the repository's **Apache-2.0** license metadata. **The underlying Llama 3.1 base model is separately governed by the [Llama 3.1 Community License](https://huggingface.co/meta-llama/Llama-3.1-8B/blob/main/LICENSE).** Combining or redistributing model weights requires complying with the applicable upstream terms.
|
| 86 |
|
| 87 |
+
See [PEFT documentation](https://huggingface.co/docs/peft/index) for loading and merging adapters.
|
|
|