SandLogicTechnologies
commited on
Commit
•
45ce389
1
Parent(s):
4bef927
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- hi
|
5 |
+
tags:
|
6 |
+
- Llama3
|
7 |
+
- Pytorch
|
8 |
+
- Bilingual
|
9 |
+
pipeline_tag: text-generation
|
10 |
+
---
|
11 |
+
# SandLogic Technologies - Quantized LLama3-Gaja-Hindi-8B Models
|
12 |
+
|
13 |
+
## Model Description
|
14 |
+
|
15 |
+
We have quantized the LLama3-Gaja-Hindi-8B model into two variants:
|
16 |
+
|
17 |
+
1. Q5_KM
|
18 |
+
2. Q4_KM
|
19 |
+
|
20 |
+
These quantized models offer improved efficiency while maintaining performance.
|
21 |
+
|
22 |
+
Discover our full range of quantized language models by visiting our [SandLogic Lexicon](https://github.com/sandlogic/SandLogic-Lexicon) GitHub. To learn more about our company and services, check out our website at [SandLogic](https://www.sandlogic.com).
|
23 |
+
|
24 |
+
## Original Model Information
|
25 |
+
|
26 |
+
- **Name**: [LLama3-Gaja-Hindi-8B-v0.1](https://huggingface.co/Cognitive-Lab/LLama3-Gaja-Hindi-8B-v0.1)
|
27 |
+
- **Developer**: Cognitivelab.in
|
28 |
+
- **Base Model**: Llama3-8B
|
29 |
+
- **Model Type**: Bilingual English/Hindi language model
|
30 |
+
- **Parameters**: 8 billion
|
31 |
+
- **Specialization**: Natural language understanding, particularly for instructional pairs
|
32 |
+
|
33 |
+
## Model Capabilities
|
34 |
+
|
35 |
+
LLama3-Gaja-Hindi-8B is designed for bilingual (English/Hindi) natural language understanding tasks, with a focus on:
|
36 |
+
|
37 |
+
- Responding appropriately in either English or Hindi based on user prompts
|
38 |
+
- Understanding and generating instructional content in both languages
|
39 |
+
- Handling a variety of natural language processing tasks across both languages
|
40 |
+
|
41 |
+
## Training Approach
|
42 |
+
|
43 |
+
The model underwent supervised fine-tuning with low-rank adaptation, focusing on bilingual instruct fine-tuning. The training data consisted of a curated dataset of translated instructional pairs.
|
44 |
+
|
45 |
+
## Use Cases
|
46 |
+
|
47 |
+
1. **Bilingual Conversational AI**: Chatbots and virtual assistants with English/Hindi capabilities
|
48 |
+
2. **Language Learning Tools**: Interactive platforms for English and Hindi learners
|
49 |
+
3. **Content Translation**: Assistance in translating between English and Hindi, especially for instructional materials
|
50 |
+
4. **Cross-lingual Information Retrieval**: Enabling queries in one language with responses in either English or Hindi
|
51 |
+
5. **Cultural Context Understanding**: Helping users grasp cultural nuances in both languages
|
52 |
+
6. **Multilingual Customer Support**: Powering customer service applications for diverse user bases
|
53 |
+
|
54 |
+
## Model Variants
|
55 |
+
|
56 |
+
We offer two quantized versions of the LLama3-Gaja-Hindi-8B model:
|
57 |
+
|
58 |
+
1. **Q5_KM**: 5-bit quantization using the KM method
|
59 |
+
2. **Q4_KM**: 4-bit quantization using the KM method
|
60 |
+
|
61 |
+
These quantized models aim to reduce model size and improve inference speed while maintaining performance as close to the original model as possible.
|
62 |
+
|
63 |
+
## Input and Output
|
64 |
+
|
65 |
+
- **Input**: Text prompts or instructions in either English or Hindi
|
66 |
+
- **Output**: Generated text responses in the same language as the input, or as specified in the prompt
|
67 |
+
|
68 |
+
## Usage
|
69 |
+
|
70 |
+
```bash
|
71 |
+
pip install llama-cpp-python
|
72 |
+
```
|
73 |
+
Please refer to the llama-cpp-python [documentation](https://llama-cpp-python.readthedocs.io/en/latest/) to install with GPU support.
|
74 |
+
|
75 |
+
### Basic Text Completion
|
76 |
+
Here's an example demonstrating how to use the high-level API for basic text completion:
|
77 |
+
|
78 |
+
```bash
|
79 |
+
from llama_cpp import Llama
|
80 |
+
|
81 |
+
llm = Llama(
|
82 |
+
model_path="./models/7B/LLama3-Gaja-Hindi-8B-v0.1.gguf",
|
83 |
+
verbose=False,
|
84 |
+
# n_gpu_layers=-1, # Uncomment to use GPU acceleration
|
85 |
+
# n_ctx=2048, # Uncomment to increase the context window
|
86 |
+
)
|
87 |
+
|
88 |
+
output = llm.create_chat_completion(
|
89 |
+
messages =[
|
90 |
+
{
|
91 |
+
"role": "system",
|
92 |
+
"content": """ You are an AI assistant trained on top of Llama 3 Large language model (LLM), proficient in English and Hindi. You can respond in both languages based on the user's request."""
|
93 |
+
|
94 |
+
,
|
95 |
+
},
|
96 |
+
{"role": "user", "content": "Write an poem in hindi"},
|
97 |
+
]
|
98 |
+
)
|
99 |
+
|
100 |
+
print(output["choices"][0]['message']['content'])
|
101 |
+
```
|
102 |
+
|
103 |
+
## Download
|
104 |
+
You can download `Llama` models in `gguf` format directly from Hugging Face using the `from_pretrained` method. This feature requires the `huggingface-hub` package.
|
105 |
+
|
106 |
+
To install it, run: `pip install huggingface-hub`
|
107 |
+
|
108 |
+
```bash
|
109 |
+
from llama_cpp import Llama
|
110 |
+
|
111 |
+
llm = Llama.from_pretrained(
|
112 |
+
repo_id="SandLogicTechnologies/LLama3-Gaja-Hindi-8B-GGUF",
|
113 |
+
filename="*llama3-gaja-hindi-8b-v0.1.Q5_K_M.gguf",
|
114 |
+
verbose=False
|
115 |
+
)
|
116 |
+
```
|
117 |
+
By default, from_pretrained will download the model to the Hugging Face cache directory. You can manage installed model files using the huggingface-cli tool.
|
118 |
+
|
119 |
+
|
120 |
+
## Ethical Considerations
|
121 |
+
|
122 |
+
Users should be aware of potential biases in the model's outputs, especially when dealing with cultural or linguistic nuances. Always review and validate the model's responses for sensitive applications.
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
## Acknowledgements
|
127 |
+
|
128 |
+
We thank Cognitivelab.in for developing the original LLama3-Gaja-Hindi-8B model and the creators of Llama3 for their foundational work.Special thanks to Georgi Gerganov and the entire llama.cpp development team for their outstanding contributions.
|
129 |
+
|
130 |
+
## Contact
|
131 |
+
|
132 |
+
For any inquiries or support, please contact us at support@sandlogic.com or visit our [support page](https://www.sandlogic.com/LingoForge/support).
|