Update README.md
Browse files
README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
---
|
2 |
-
base_model: unsloth/meta-llama-3.1-8b-bnb-4bit
|
3 |
language:
|
4 |
- en
|
|
|
5 |
license: apache-2.0
|
6 |
tags:
|
7 |
- text-generation-inference
|
@@ -12,12 +12,79 @@ tags:
|
|
12 |
- sft
|
13 |
---
|
14 |
|
15 |
-
#
|
16 |
|
17 |
-
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
22 |
|
23 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
1 |
---
|
|
|
2 |
language:
|
3 |
- en
|
4 |
+
- it
|
5 |
license: apache-2.0
|
6 |
tags:
|
7 |
- text-generation-inference
|
|
|
12 |
- sft
|
13 |
---
|
14 |
|
15 |
+
# Meta LLaMA 3.1 8B 4-bit Finetuned Model
|
16 |
|
17 |
+
This model is a fine-tuned version of `Meta-Llama-3.1-8B`, developed by **ruslanmv** for text generation tasks. It leverages 4-bit quantization, making it more efficient for inference while maintaining strong performance in natural language generation.
|
18 |
+
|
19 |
+
---
|
20 |
+
|
21 |
+
## Model Details
|
22 |
+
|
23 |
+
- **Base Model**: `unsloth/meta-llama-3.1-8b-bnb-4bit`
|
24 |
+
- **Finetuned by**: ruslanmv
|
25 |
+
- **Language**: English
|
26 |
+
- **License**: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
27 |
+
- **Tags**:
|
28 |
+
- text-generation-inference
|
29 |
+
- transformers
|
30 |
+
- unsloth
|
31 |
+
- llama
|
32 |
+
- trl
|
33 |
+
- sft
|
34 |
+
|
35 |
+
---
|
36 |
+
|
37 |
+
## Model Usage
|
38 |
+
|
39 |
+
### Installation
|
40 |
+
|
41 |
+
To use this model, you will need to install the necessary libraries:
|
42 |
+
|
43 |
+
```bash
|
44 |
+
pip install transformers accelerate bitsandbytes
|
45 |
+
```
|
46 |
+
|
47 |
+
### Loading the Model in Python
|
48 |
+
|
49 |
+
Here’s an example of how to load this fine-tuned model using Hugging Face's `transformers` library:
|
50 |
+
|
51 |
+
```python
|
52 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
53 |
+
import torch
|
54 |
+
|
55 |
+
# Load the model and tokenizer
|
56 |
+
model_name = "Meta-Llama-3.1-8B-Text-to-SQL-4bit"
|
57 |
+
|
58 |
+
# Ensure you have the right device setup
|
59 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
60 |
+
|
61 |
+
# Load the model and tokenizer from the Hugging Face Hub
|
62 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.float16)
|
63 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
64 |
+
|
65 |
+
# Example usage
|
66 |
+
input_text = "Recupera il conteggio di tutte le righe nella tabella table1"
|
67 |
+
inputs = tokenizer(input_text, return_tensors="pt").to(device)
|
68 |
+
|
69 |
+
# Generate output text
|
70 |
+
outputs = model.generate(**inputs, max_length=50)
|
71 |
+
|
72 |
+
# Decode and print the generated text
|
73 |
+
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
74 |
+
print(generated_text)
|
75 |
+
```
|
76 |
+
|
77 |
+
### Model Features
|
78 |
+
|
79 |
+
- **Text Generation**: This model is fine-tuned to generate coherent and contextually accurate text based on the provided input.
|
80 |
+
- **Efficiency**: Using 4-bit quantization with the `bitsandbytes` library, it optimizes memory and inference performance.
|
81 |
+
|
82 |
+
### License
|
83 |
+
|
84 |
+
This model is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). You are free to use, modify, and distribute this model, provided that you comply with the license terms.
|
85 |
+
|
86 |
+
### Acknowledgments
|
87 |
+
|
88 |
+
This model was fine-tuned by **ruslanmv** based on the original work of `unsloth` and the `meta-llama-3.1-8b-bnb-4bit` model.
|
89 |
|
|
|
90 |
|
|