tolgadev commited on
Commit
fb62f0c
1 Parent(s): 4b2db99

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -22
README.md CHANGED
@@ -75,15 +75,14 @@ The following clients/libraries will automatically download models for you, prov
75
 
76
  -----
77
 
78
- ## Trendyol LLM 7b base v0.1
79
-
 
 
80
  Trendyol LLM is a generative model that is based on LLaMa2 7B model. This is the repository for the base model.
81
 
82
  ## Model Details
83
 
84
- - **Model creator:** [Trendyol](https://huggingface.co/Trendyol)
85
- - **Original model:** [Trendyol-LLM-7b-base-v0.1](https://huggingface.co/Trendyol/Trendyol-LLM-7b-base-v0.1)
86
-
87
  **Model Developers** Trendyol
88
 
89
  **Variations** base and chat variations.
@@ -92,9 +91,9 @@ Trendyol LLM is a generative model that is based on LLaMa2 7B model. This is the
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
@@ -102,17 +101,23 @@ Trendyol LLM is a generative model that is based on LLaMa2 7B model. This is the
102
  - **lora_dropout**=0.05
103
  - **fp16**=True
104
  - **max_seq_length**=1024
 
105
  <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/peft/lora_diagram.png"
106
  alt="drawing" width="600"/>
 
107
  ## Usage
 
108
  ```python
109
  from transformers import AutoModelForCausalLM, LlamaTokenizer, pipeline
110
- model_id = "Trendyol/Trendyol-LLM-7b-chat-v0.1"
 
111
  tokenizer = LlamaTokenizer.from_pretrained(model_id)
112
  model = AutoModelForCausalLM.from_pretrained(model_id,
113
  device_map='auto',
114
  load_in_8bit=True)
 
115
  sampling_params = dict(do_sample=True, temperature=0.3, top_k=50, top_p=0.9)
 
116
  pipe = pipeline("text-generation",
117
  model=model,
118
  tokenizer=tokenizer,
@@ -121,34 +126,40 @@ pipe = pipeline("text-generation",
121
  return_full_text=True,
122
  repetition_penalty=1.1
123
  )
124
- DEFAULT_SYSTEM_PROMPT = "Sen yardımcı bir asistansın ve sana verilen talimatlar doğrultusunda en iyi cevabı üretmeye çalışacaksın.\n"
125
- TEMPLATE = (
126
- "[INST] <<SYS>>\n"
127
- "{system_prompt}\n"
128
- "<</SYS>>\n\n"
129
- "{instruction} [/INST]"
130
- )
131
- def generate_prompt(instruction, system_prompt=DEFAULT_SYSTEM_PROMPT):
132
- return TEMPLATE.format_map({'instruction': instruction,'system_prompt': system_prompt})
133
- def generate_output(user_query, sys_prompt=DEFAULT_SYSTEM_PROMPT):
134
- prompt = generate_prompt(user_query, sys_prompt)
135
- outputs = pipe(prompt,
136
  **sampling_params
137
  )
138
- return outputs[0]["generated_text"].split("[/INST]")[-1]
139
- user_query = "Türkiye'de kaç il var?"
 
140
  response = generate_output(user_query)
141
  ```
 
142
  ## Limitations, Risks, Bias, and Ethical Considerations
 
143
  ### Limitations and Known Biases
 
144
  - **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.
 
145
  - **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.
 
146
  - **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.
 
147
  ### Risks and Ethical Considerations
 
148
  - **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.
 
149
  - **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.
 
150
  - **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.
 
151
  ### Recommendations for Safe and Ethical Usage
 
152
  - **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.
 
153
  - **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.
 
154
  - **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.
 
75
 
76
  -----
77
 
78
+ ## Model Details
79
+ <img src="https://huggingface.co/Trendyol/Trendyol-LLM-7b-base-v0.1/resolve/main/llama-tr-image.jpeg"
80
+ alt="drawing" width="400"/>
81
+ # **Trendyol LLM**
82
  Trendyol LLM is a generative model that is based on LLaMa2 7B model. This is the repository for the base model.
83
 
84
  ## Model Details
85
 
 
 
 
86
  **Model Developers** Trendyol
87
 
88
  **Variations** base and chat variations.
 
91
 
92
  **Output** Models generate text only.
93
 
94
+ **Model Architecture** Trendyol LLM is an auto-regressive language model (based on LLaMa2 7b) that uses an optimized transformer architecture. The base version is fine-tuned on 10 billion tokens with the following trainables by using LoRA:
95
 
96
+ - **lr**=2e-4
97
  - **lora_rank**=64
98
  - **lora_alpha**=128
99
  - **lora_trainable**=q_proj,v_proj,k_proj,o_proj,gate_proj,down_proj,up_proj
 
101
  - **lora_dropout**=0.05
102
  - **fp16**=True
103
  - **max_seq_length**=1024
104
+
105
  <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/peft/lora_diagram.png"
106
  alt="drawing" width="600"/>
107
+
108
  ## Usage
109
+
110
  ```python
111
  from transformers import AutoModelForCausalLM, LlamaTokenizer, pipeline
112
+
113
+ model_id = "Trendyol/Trendyol-LLM-7b-base-v0.1"
114
  tokenizer = LlamaTokenizer.from_pretrained(model_id)
115
  model = AutoModelForCausalLM.from_pretrained(model_id,
116
  device_map='auto',
117
  load_in_8bit=True)
118
+
119
  sampling_params = dict(do_sample=True, temperature=0.3, top_k=50, top_p=0.9)
120
+
121
  pipe = pipeline("text-generation",
122
  model=model,
123
  tokenizer=tokenizer,
 
126
  return_full_text=True,
127
  repetition_penalty=1.1
128
  )
129
+
130
+
131
+ def generate_output(user_query):
132
+ outputs = pipe(user_query,
 
 
 
 
 
 
 
 
133
  **sampling_params
134
  )
135
+ return outputs[0]["generated_text"]
136
+
137
+ user_query = "Ders çalışmanın en iyi 5 yolu:"
138
  response = generate_output(user_query)
139
  ```
140
+
141
  ## Limitations, Risks, Bias, and Ethical Considerations
142
+
143
  ### Limitations and Known Biases
144
+
145
  - **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.
146
+
147
  - **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.
148
+
149
  - **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.
150
+
151
  ### Risks and Ethical Considerations
152
+
153
  - **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.
154
+
155
  - **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.
156
+
157
  - **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.
158
+
159
  ### Recommendations for Safe and Ethical Usage
160
+
161
  - **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.
162
+
163
  - **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.
164
+
165
  - **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.