ogulcanakca commited on
Commit
56e70a5
·
verified ·
1 Parent(s): f5914fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +87 -9
README.md CHANGED
@@ -1,22 +1,100 @@
1
  ---
2
  base_model: vngrs-ai/Kumru-2B-Base
 
3
  tags:
4
- - text-generation-inference
5
  - transformers
 
 
 
 
 
 
 
 
 
6
  - unsloth
7
  - mistral
8
  - trl
9
- license: apache-2.0
10
  language:
11
- - en
 
 
 
 
 
12
  ---
13
 
14
- # Uploaded model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- - **Developed by:** ogulcanakca
17
- - **License:** apache-2.0
18
- - **Finetuned from model :** vngrs-ai/Kumru-2B-Base
19
 
20
- This mistral model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
21
 
22
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
1
  ---
2
  base_model: vngrs-ai/Kumru-2B-Base
3
+ license: apache-2.0
4
  tags:
 
5
  - transformers
6
+ - peft
7
+ - dpo
8
+ - dapt
9
+ - kumru
10
+ - epdk
11
+ - qlora
12
+ - lora
13
+ - causal-lm
14
+ - text-generation-inference
15
  - unsloth
16
  - mistral
17
  - trl
 
18
  language:
19
+ - tr
20
+ datasets:
21
+ - ogulcanakca/epdk_dpo
22
+ - ogulcanakca/epdk_corpus
23
+ pipeline_tag: text-generation
24
+ library_name: transformers
25
  ---
26
 
27
+ # Model Card
28
+
29
+ `vngrs-ai/Kumru-2B-Base` modelinin **iki aşamalı (DAPT + DPO) bir fine-tuning** sürecinden geçirilmesiyle oluşturulmuş **nihai** modelidir. Model, Enerji Piyasası Düzenleme Kurumu (EPDK) mevzuatları konusunda uzmanlaşmış bir **instruct modelidir.**
30
+
31
+ Bu model, `llama.cpp` ve `Ollama` gibi platformlarda kullanılmak üzere [`ogulcanakca/Kumru-2B-EPDK-Instruct-GGUF`]() reposunda **GGUF formatında** da mevcuttur.
32
+
33
+ ```python
34
+ !pip install -q \
35
+ "transformers" \
36
+ "peft" \
37
+ "accelerate" \
38
+ "bitsandbytes" \
39
+ "trl" \
40
+ "datasets"
41
+
42
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
43
+ import torch
44
+
45
+ model_name = "ogulcanakca/Kumru-2B-EPDK-Instruct"
46
+
47
+ # 4-bit QLoRA ile yükleme
48
+ bnb_config = BitsAndBytesConfig(
49
+ load_in_4bit=True,
50
+ bnb_4bit_quant_type="nf4",
51
+ bnb_4bit_compute_dtype=torch.float16 # T4 için
52
+ )
53
+
54
+ tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
55
+ model = AutoModelForCausalLM.from_pretrained(
56
+ model_name,
57
+ quantization_config=bnb_config,
58
+ device_map="auto",
59
+ trust_remote_code=True
60
+ )
61
+ model.eval()
62
+
63
+ prompt_soru = "2007 yılına ait Türkiye Ortalama Elektrik Toptan Satış Fiyatının (TORETOSAF) değeri nedir?"
64
+
65
+ messages = [
66
+ {"role": "user", "content": prompt_soru}
67
+ ]
68
+
69
+ input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
70
+ inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
71
+
72
+ inputs.pop("token_type_ids", None)
73
+
74
+ with torch.no_grad():
75
+ outputs = model.generate(
76
+ **inputs,
77
+ max_new_tokens=150,
78
+ temperature=0.2,
79
+ do_sample=True,
80
+ pad_token_id=tokenizer.eos_token_id
81
+ )
82
+
83
+ response_start_index = inputs.input_ids.shape[1]
84
+ print(tokenizer.decode(outputs[0][response_start_index:], skip_special_tokens=True))
85
+ ```
86
+
87
+ ## GGUF (llama.cpp)
88
+
89
+ **GGUF Reposu:** 👉 [**ogulcanakca/Kumru-2B-EPDK-Instruct-GGUF**](https://huggingface.co/ogulcanakca/Kumru-2B-EPDK-Instruct-GGUF)
90
 
91
+ ## WandB
 
 
92
 
93
+ [WandB report](https://api.wandb.ai/links/ogulcanakca-none/z06caml6)
94
 
95
+ ```json
96
+ {
97
+ "prompt": "2007 yılına ait Türkiye Ortalama Elektrik Toptan Satış Fiyatının (TORETOSAF) değeri nedir?",
98
+ "Instruct Model": "TORETOSAF, 2013 yılı için, 12 aylık TÜFE ile TEFE arasındaki farktır. 2013 yılı için % 10,11’dir."
99
+ }
100
+ ```