tolgadev commited on
Commit
f17524a
1 Parent(s): 8a2a830

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +178 -0
README.md ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ model_name: Trendyol-LLM-7b-chat-v0.1
3
+ model_creator: Trendyol
4
+ base_model: Trendyol/Trendyol-LLM-7b-chat-v0.1
5
+ language:
6
+ - tr
7
+ - en
8
+ pipeline_tag: text-generation
9
+ license: apache-2.0
10
+ model_type: llama
11
+ library_name: transformers
12
+ inference: false
13
+ tags:
14
+ - trendyol
15
+ - llama-2
16
+ - turkish
17
+ quantized_by: tolgadev
18
+ ---
19
+ ## Trendyol-LLM-7b-chat-v0.1-GGUF models
20
+ ----
21
+ ## Description
22
+
23
+ This repo contains all types of GGUF formatted model files for [Trendyol-LLM-7b-chat-v0.1](https://huggingface.co/Trendyol/Trendyol-LLM-7b-chat-v0.1).
24
+
25
+ <img src="https://huggingface.co/Trendyol/Trendyol-LLM-7b-chat-v0.1/resolve/main/llama-tr-image.jpeg"
26
+ alt="drawing" width="400"/>
27
+
28
+ ## Quantized LLM models and methods
29
+ | Name | Quant method | Bits | Size | Max RAM required | Use case |
30
+ | ---- | ---- | ---- | ---- | ---- | ----- |
31
+ | [Trendyol-LLM-7b-chat-v0.1.Q2_K.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q2_K.gguf) | Q2_K | 2 | 2.59 GB| 4.88 GB | smallest, significant quality loss - not recommended for most purposes |
32
+ | [Trendyol-LLM-7b-chat-v0.1.Q3_K_S.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q3_K_S.gguf) | Q3_K_S | 3 | 3.01 GB| 5.56 GB | very small, high quality loss |
33
+ | [Trendyol-LLM-7b-chat-v0.1.Q3_K_M.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q3_K_M.gguf) | Q3_K_M | 3 | 3.36 GB| 5.91 GB | very small, high quality loss |
34
+ | [Trendyol-LLM-7b-chat-v0.1.Q3_K_L.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q3_K_L.gguf) | Q3_K_L | 3 | 3.66 GB| 6.20 GB | small, substantial quality loss |
35
+ | [Trendyol-LLM-7b-chat-v0.1.Q4_0.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q4_0.gguf) | Q4_0 | 4 | 3.9 GB| 6.45 GB | legacy; small, very high quality loss - prefer using Q3_K_M |
36
+ | [Trendyol-LLM-7b-chat-v0.1.Q4_K_S.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q4_K_S.gguf) | Q4_K_S | 4 | 3.93 GB| 6.48 GB | small, greater quality loss |
37
+ | [Trendyol-LLM-7b-chat-v0.1.Q4_K_M.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q4_K_M.gguf) | Q4_K_M | 4 | 4.15 GB| 6.69 GB | medium, balanced quality - recommended |
38
+ | [Trendyol-LLM-7b-chat-v0.1.Q5_0.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q5_0.gguf) | Q5_0 | 5 | 4.73 GB| 7.15 GB | legacy; medium, balanced quality - prefer using Q4_K_M |
39
+ | [Trendyol-LLM-7b-chat-v0.1.Q5_K_S.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q5_K_S.gguf) | Q5_K_S | 5 | 4.75 GB| 7.27 GB | large, low quality loss - recommended |
40
+ | [Trendyol-LLM-7b-chat-v0.1.Q5_K_M.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q5_K_M.gguf) | Q5_K_M | 5 | 4.86 GB| 7.40 GB | large, very low quality loss - recommended |
41
+ | [Trendyol-LLM-7b-chat-v0.1.Q6_K.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q6_K.gguf) | Q6_K | 6 | 5.61 GB| 8.15 GB | very large, extremely low quality loss |
42
+ | [Trendyol-LLM-7b-chat-v0.1.Q8_0.gguf](https://huggingface.co/tolgadev/Trendyol-LLM-7b-chat-v0.1-GGUF/blob/main/trendyol-llm-7b-chat-v0.1.Q8_0.gguf) | Q8_0 | 8 | 7.27 GB| 9.81 GB | very large, extremely low quality loss - not recommended |
43
+
44
+ The names of the quantization methods follow the naming convention: "q" + the number of bits + the variant used (detailed below). Here is a list of all the models and their corresponding use cases, based on model cards made by [TheBloke](https://huggingface.co/TheBloke/):
45
+
46
+ * `q2_k`: Uses Q4_K for the attention.vw and feed_forward.w2 tensors, Q2_K for the other tensors.
47
+ * `q3_k_l`: Uses Q5_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else Q3_K
48
+ * `q3_k_m`: Uses Q4_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else Q3_K
49
+ * `q3_k_s`: Uses Q3_K for all tensors
50
+ * `q4_0`: Original quant method, 4-bit.
51
+ * `q4_1`: Higher accuracy than q4_0 but not as high as q5_0. However has quicker inference than q5 models.
52
+ * `q4_k_m`: Uses Q6_K for half of the attention.wv and feed_forward.w2 tensors, else Q4_K
53
+ * `q4_k_s`: Uses Q4_K for all tensors
54
+ * `q5_0`: Higher accuracy, higher resource usage and slower inference.
55
+ * `q5_1`: Even higher accuracy, resource usage and slower inference.
56
+ * `q5_k_m`: Uses Q6_K for half of the attention.wv and feed_forward.w2 tensors, else Q5_K
57
+ * `q5_k_s`: Uses Q5_K for all tensors
58
+ * `q6_k`: Uses Q8_K for all tensors
59
+ * `q8_0`: Almost indistinguishable from float16. High resource use and slow. Not recommended for most users.
60
+
61
+ **TheBloke recommends using Q5_K_M** as it preserves most of the model's performance.
62
+ Alternatively, you can use Q4_K_M if you want to save some memory.
63
+ In general, K_M versions are better than K_S versions.
64
+
65
+ ## How to download GGUF files
66
+
67
+ **Note for manual downloaders:** You almost never want to clone the entire repo! Multiple different quantisation formats are provided, and most users only want to pick and download a single file.
68
+
69
+ The following clients/libraries will automatically download models for you, providing a list of available models to choose from:
70
+ - LM Studio
71
+ - LoLLMS Web UI
72
+ - Faraday.dev
73
+
74
+ ## Special thanks to [TheBloke on Huggingface](https://huggingface.co/TheBloke) and [Maxime Labonne on Github](https://github.com/mlabonne/llm-course)
75
+
76
+ -----
77
+
78
+ ## Model Details
79
+
80
+ <img src="https://huggingface.co/Trendyol/Trendyol-LLM-7b-chat-v0.1/resolve/main/llama-tr-image.jpeg"
81
+ alt="drawing" width="400"/>
82
+ # **Trendyol LLM**
83
+ Trendyol LLM is a generative model that is based on LLaMa2 7B model. This is the repository for the chat model.
84
+
85
+ ## Model Details
86
+
87
+ **Model Developers** Trendyol
88
+
89
+ **Variations** base and chat variations.
90
+
91
+ **Input** Models input text only.
92
+
93
+ **Output** Models generate text only.
94
+
95
+ **Model Architecture** Trendyol LLM is an auto-regressive language model (based on LLaMa2 7b) that uses an optimized transformer architecture. The chat version is fine-tuned on 180K instruction sets with the following trainables by using LoRA:
96
+
97
+ - **lr**=1e-4
98
+ - **lora_rank**=64
99
+ - **lora_alpha**=128
100
+ - **lora_trainable**=q_proj,v_proj,k_proj,o_proj,gate_proj,down_proj,up_proj
101
+ - **modules_to_save**=embed_tokens,lm_head
102
+ - **lora_dropout**=0.05
103
+ - **fp16**=True
104
+ - **max_seq_length**=1024
105
+
106
+ <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/peft/lora_diagram.png"
107
+ alt="drawing" width="600"/>
108
+
109
+ ## Usage
110
+
111
+ ```python
112
+ from transformers import AutoModelForCausalLM, LlamaTokenizer, pipeline
113
+
114
+ model_id = "Trendyol/Trendyol-LLM-7b-chat-v0.1"
115
+ tokenizer = LlamaTokenizer.from_pretrained(model_id)
116
+ model = AutoModelForCausalLM.from_pretrained(model_id,
117
+ device_map='auto',
118
+ load_in_8bit=True)
119
+
120
+ sampling_params = dict(do_sample=True, temperature=0.3, top_k=50, top_p=0.9)
121
+
122
+ pipe = pipeline("text-generation",
123
+ model=model,
124
+ tokenizer=tokenizer,
125
+ device_map="auto",
126
+ max_new_tokens=1024,
127
+ return_full_text=True,
128
+ repetition_penalty=1.1
129
+ )
130
+
131
+ DEFAULT_SYSTEM_PROMPT = "Sen yardımcı bir asistansın ve sana verilen talimatlar doğrultusunda en iyi cevabı üretmeye çalışacaksın.\n"
132
+
133
+ TEMPLATE = (
134
+ "[INST] <<SYS>>\n"
135
+ "{system_prompt}\n"
136
+ "<</SYS>>\n\n"
137
+ "{instruction} [/INST]"
138
+ )
139
+
140
+ def generate_prompt(instruction, system_prompt=DEFAULT_SYSTEM_PROMPT):
141
+ return TEMPLATE.format_map({'instruction': instruction,'system_prompt': system_prompt})
142
+
143
+ def generate_output(user_query, sys_prompt=DEFAULT_SYSTEM_PROMPT):
144
+ prompt = generate_prompt(user_query, sys_prompt)
145
+ outputs = pipe(prompt,
146
+ **sampling_params
147
+ )
148
+ return outputs[0]["generated_text"].split("[/INST]")[-1]
149
+
150
+ user_query = "Türkiye'de kaç il var?"
151
+ response = generate_output(user_query)
152
+ ```
153
+
154
+ ## Limitations, Risks, Bias, and Ethical Considerations
155
+
156
+ ### Limitations and Known Biases
157
+
158
+ - **Primary Function and Application:** Trendyol LLM, an autoregressive language model, is primarily designed to predict the next token in a text string. While often used for various applications, it is important to note that it has not undergone extensive real-world application testing. Its effectiveness and reliability across diverse scenarios remain largely unverified.
159
+
160
+ - **Language Comprehension and Generation:** The model is primarily trained in standard English and Turkish. Its performance in understanding and generating slang, informal language, or other languages may be limited, leading to potential errors or misinterpretations.
161
+
162
+ - **Generation of False Information:** Users should be aware that Trendyol LLM may produce inaccurate or misleading information. Outputs should be considered as starting points or suggestions rather than definitive answers.
163
+
164
+ ### Risks and Ethical Considerations
165
+
166
+ - **Potential for Harmful Use:** There is a risk that Trendyol LLM could be used to generate offensive or harmful language. We strongly discourage its use for any such purposes and emphasize the need for application-specific safety and fairness evaluations before deployment.
167
+
168
+ - **Unintended Content and Bias:** The model was trained on a large corpus of text data, which was not explicitly checked for offensive content or existing biases. Consequently, it may inadvertently produce content that reflects these biases or inaccuracies.
169
+
170
+ - **Toxicity:** Despite efforts to select appropriate training data, the model is capable of generating harmful content, especially when prompted explicitly. We encourage the open-source community to engage in developing strategies to minimize such risks.
171
+
172
+ ### Recommendations for Safe and Ethical Usage
173
+
174
+ - **Human Oversight:** We recommend incorporating a human curation layer or using filters to manage and improve the quality of outputs, especially in public-facing applications. This approach can help mitigate the risk of generating objectionable content unexpectedly.
175
+
176
+ - **Application-Specific Testing:** Developers intending to use Trendyol LLM should conduct thorough safety testing and optimization tailored to their specific applications. This is crucial, as the model’s responses can be unpredictable and may occasionally be biased, inaccurate, or offensive.
177
+
178
+ - **Responsible Development and Deployment:** It is the responsibility of developers and users of Trendyol LLM to ensure its ethical and safe application. We urge users to be mindful of the model's limitations and to employ appropriate safeguards to prevent misuse or harmful consequences.