munish0838 commited on
Commit
f90a7f6
·
verified ·
1 Parent(s): 233a65c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +112 -0
README.md ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama3
3
+ language:
4
+ - tr
5
+ pipeline_tag: text-generation
6
+ base_model: ytu-ce-cosmos/Turkish-Llama-8b-Instruct-v0.1
7
+ tags:
8
+ - Turkish
9
+ - turkish
10
+ - Llama
11
+ - Llama3
12
+ ---
13
+
14
+ # QuantFactory/Turkish-Llama-8b-Instruct-v0.1-GGUF
15
+ This is quantized version of [ytu-ce-cosmos/Turkish-Llama-8b-Instruct-v0.1](https://huggingface.co/ytu-ce-cosmos/Turkish-Llama-8b-Instruct-v0.1) created suign llama.cpp
16
+
17
+ # Model Description
18
+
19
+ <img src="./cosmosLLaMa2_r2.png"/>
20
+
21
+ This model is a fully fine-tuned version of the "meta-llama/Meta-Llama-3-8B-Instruct" model with a 30GB Turkish dataset.
22
+
23
+ The Cosmos LLaMa Instruct 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.
24
+
25
+
26
+ #### Transformers pipeline
27
+
28
+ ```python
29
+ import transformers
30
+ import torch
31
+
32
+ model_id = "ytu-ce-cosmos/Turkish-Llama-8b-Instruct-v0.1"
33
+
34
+ pipeline = transformers.pipeline(
35
+ "text-generation",
36
+ model=model_id,
37
+ model_kwargs={"torch_dtype": torch.bfloat16},
38
+ device_map="auto",
39
+ )
40
+
41
+ messages = [
42
+ {"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."},
43
+ {"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?"},
44
+ ]
45
+
46
+ terminators = [
47
+ pipeline.tokenizer.eos_token_id,
48
+ pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
49
+ ]
50
+
51
+ outputs = pipeline(
52
+ messages,
53
+ max_new_tokens=256,
54
+ eos_token_id=terminators,
55
+ do_sample=True,
56
+ temperature=0.6,
57
+ top_p=0.9,
58
+ )
59
+ print(outputs[0]["generated_text"][-1])
60
+ ```
61
+
62
+ #### Transformers AutoModelForCausalLM
63
+
64
+ ```python
65
+ from transformers import AutoTokenizer, AutoModelForCausalLM
66
+ import torch
67
+
68
+ model_id = "ytu-ce-cosmos/Turkish-Llama-8b-Instruct-v0.1"
69
+
70
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
71
+ model = AutoModelForCausalLM.from_pretrained(
72
+ model_id,
73
+ torch_dtype=torch.bfloat16,
74
+ device_map="auto",
75
+ )
76
+
77
+ messages = [
78
+ {"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."},
79
+ {"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?"},
80
+ ]
81
+
82
+ input_ids = tokenizer.apply_chat_template(
83
+ messages,
84
+ add_generation_prompt=True,
85
+ return_tensors="pt"
86
+ ).to(model.device)
87
+
88
+ terminators = [
89
+ tokenizer.eos_token_id,
90
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
91
+ ]
92
+
93
+ outputs = model.generate(
94
+ input_ids,
95
+ max_new_tokens=256,
96
+ eos_token_id=terminators,
97
+ do_sample=True,
98
+ temperature=0.6,
99
+ top_p=0.9,
100
+ )
101
+ response = outputs[0][input_ids.shape[-1]:]
102
+ print(tokenizer.decode(response, skip_special_tokens=True))
103
+ ```
104
+
105
+ ### Model Contact
106
+ COSMOS AI Research Group, Yildiz Technical University Computer Engineering Department <br>
107
+ https://cosmos.yildiz.edu.tr/ <br>
108
109
+
110
+ ---
111
+ license: llama3
112
+ ---