sixfingerdev commited on
Commit
8b54ed6
·
verified ·
1 Parent(s): 48f3b0a

Clarify model limitations and fix usage instructions

Browse files
Files changed (1) hide show
  1. README.md +44 -79
README.md CHANGED
@@ -7,7 +7,7 @@ tags:
7
  - lora
8
  - sft
9
  - transformers
10
- - trl
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
- This repository contains a **LoRA adapter** for the SixFinger-8B model.
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
- ## Overview
28
 
29
- - **Base Model:** unsloth/llama-3.1-8b-bnb-4bit
30
- - **Adapter Type:** LoRA
31
- - **Quantization:** 4-bit (via bitsandbytes)
32
- - **Purpose:** Enhanced response generation for Turkish/English mixed datasets.
33
- - **Compatibility:** Use with Hugging Face Transformers + PEFT library.
 
 
34
 
35
- ---
36
 
37
  ## Installation
38
 
39
- Install required dependencies:
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
- 2. **Load the Adapter**
60
-
61
- 'from peft import PeftModel'
62
-
63
- 'model = PeftModel.from_pretrained('
64
- ' base_model,'
65
- ' "sixfingerdev/SixFinger-8B"'
66
- ')'
67
 
68
- 3. **Load the Tokenizer**
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
- # Base model
83
- base_model = AutoModelForCausalLM.from_pretrained(
84
- "unsloth/llama-3.1-8b-bnb-4bit",
85
- device_map="auto"
86
- )
87
 
88
- # LoRA adapter
89
- model = PeftModel.from_pretrained(base_model, "sixfingerdev/SixFinger-8B")
 
 
90
 
91
- # Tokenizer
92
- tokenizer = AutoTokenizer.from_pretrained("unsloth/llama-3.1-8b-bnb-4bit")
93
 
94
- # Örnek text generation
95
- prompt = "Soru: Yapay zeka nedir?\nCevap:"
96
- inputs = tokenizer(prompt, return_tensors="pt")
97
- with torch.no_grad():
98
- outputs = model.generate(**inputs, max_new_tokens=50, do_sample=True, temperature=0.7)
 
 
99
 
100
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
 
101
  ```
102
- ---
103
-
104
- ## Notes
105
 
106
- - The adapter does **not** modify the base model; it only applies LoRA weights on top.
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
- ## References
 
 
 
113
 
114
- - [PEFT (Parameter-Efficient Fine-Tuning)](https://huggingface.co/docs/peft/index)
115
- - [Transformers 4-bit Quantization](https://huggingface.co/docs/transformers/main/en/main_classes/quantization)
116
-
117
- ---
118
 
119
- ## License
120
 
121
- The adapter and its usage are provided under the terms specified in the repository.
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.