aashish1904 commited on
Commit
b706d1e
1 Parent(s): ee82935

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +130 -0
README.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ license: llama3
5
+ language:
6
+ - tr
7
+ pipeline_tag: text-generation
8
+ base_model: meta-llama/Meta-Llama-3-8B
9
+ tags:
10
+ - Turkish
11
+ - turkish
12
+ - Llama
13
+ - Llama3
14
+
15
+ ---
16
+
17
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
18
+
19
+
20
+ # QuantFactory/Turkish-Llama-8b-DPO-v0.1-GGUF
21
+ This is quantized version of [ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1](https://huggingface.co/ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1) created using llama.cpp
22
+
23
+ # Original Model Card
24
+
25
+
26
+ <img src="./cosmosLLaMa2_r2.png"/>
27
+
28
+
29
+ # Cosmos LLaMa Instruct-DPO
30
+
31
+ This is the newest and the most advanced iteration of CosmosLLama. The model has been developed by merging two distinctly trained CosmosLLaMa-Instruct DPO models.
32
+
33
+ The CosmosLLaMa-Instruct DPO is designed for text generation tasks, providing the ability to continue a given text snippet in a coherent and contextually relevant manner. Due to the diverse nature of the training data, which includes websites, books, and other text sources, this model can exhibit biases. Users should be aware of these biases and use the model responsibly.
34
+
35
+ You can easily demo the model from here: https://cosmos.yildiz.edu.tr/cosmosllama
36
+
37
+ #### Transformers pipeline
38
+
39
+ ```python
40
+ import transformers
41
+ import torch
42
+
43
+ model_id = "ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1"
44
+
45
+ pipeline = transformers.pipeline(
46
+ "text-generation",
47
+ model=model_id,
48
+ model_kwargs={"torch_dtype": torch.bfloat16},
49
+ device_map="auto",
50
+ )
51
+
52
+ messages = [
53
+ {"role": "system", "content": "Sen bir yapay zeka asistanısın. Kullanıcı sana bir görev verecek. Amacın görevi olabildiğince sadık bir şekilde tamamlamak. Görevi yerine getirirken adım adım düşün ve adımlarını gerekçelendir."},
54
+ {"role": "user", "content": "Soru: Bir arabanın deposu 60 litre benzin alabiliyor. Araba her 100 kilometrede 8 litre benzin tüketiyor. Depo tamamen doluyken araba kaç kilometre yol alabilir?"},
55
+ ]
56
+
57
+ terminators = [
58
+ pipeline.tokenizer.eos_token_id,
59
+ pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
60
+ ]
61
+
62
+ outputs = pipeline(
63
+ messages,
64
+ max_new_tokens=256,
65
+ eos_token_id=terminators,
66
+ do_sample=True,
67
+ temperature=0.6,
68
+ top_p=0.9,
69
+ )
70
+ print(outputs[0]["generated_text"][-1])
71
+ ```
72
+
73
+ #### Transformers AutoModelForCausalLM
74
+
75
+ ```python
76
+ from transformers import AutoTokenizer, AutoModelForCausalLM
77
+ import torch
78
+
79
+ model_id = "ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1"
80
+
81
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
82
+ model = AutoModelForCausalLM.from_pretrained(
83
+ model_id,
84
+ torch_dtype=torch.bfloat16,
85
+ device_map="auto",
86
+ )
87
+
88
+ messages = [
89
+ {"role": "system", "content": "Sen bir yapay zeka asistanısın. Kullanıcı sana bir görev verecek. Amacın görevi olabildiğince sadık bir şekilde tamamlamak. Görevi yerine getirirken adım adım düşün ve adımlarını gerekçelendir."},
90
+ {"role": "user", "content": "Soru: Bir arabanın deposu 60 litre benzin alabiliyor. Araba her 100 kilometrede 8 litre benzin tüketiyor. Depo tamamen doluyken araba kaç kilometre yol alabilir?"},
91
+ ]
92
+
93
+ input_ids = tokenizer.apply_chat_template(
94
+ messages,
95
+ add_generation_prompt=True,
96
+ return_tensors="pt"
97
+ ).to(model.device)
98
+
99
+ terminators = [
100
+ tokenizer.eos_token_id,
101
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
102
+ ]
103
+
104
+ outputs = model.generate(
105
+ input_ids,
106
+ max_new_tokens=256,
107
+ eos_token_id=terminators,
108
+ do_sample=True,
109
+ temperature=0.6,
110
+ top_p=0.9,
111
+ )
112
+ response = outputs[0][input_ids.shape[-1]:]
113
+ print(tokenizer.decode(response, skip_special_tokens=True))
114
+ ```
115
+
116
+
117
+ # Acknowledgments
118
+ - Thanks to the generous support from the Hugging Face team, it is possible to download models from their S3 storage 🤗
119
+ - Computing resources used in this work were provided by the National Center for High Performance Computing of Turkey (UHeM) under grant numbers 1016912023 and
120
+ 1018512024
121
+ - Research supported with Cloud TPUs from Google's TPU Research Cloud (TRC)
122
+
123
+ ### Contact
124
+ COSMOS AI Research Group, Yildiz Technical University Computer Engineering Department <br>
125
+ https://cosmos.yildiz.edu.tr/ <br>
126
127
+
128
+ ---
129
+ license: llama3
130
+ ---