lipcut commited on
Commit
387ea1b
1 Parent(s): 27edc6d

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +74 -0
README.md ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - merge
4
+ - mergekit
5
+ - lazymergekit
6
+ - argilla/CapybaraHermes-2.5-Mistral-7B
7
+ - WizardLM/WizardMath-7B-V1.1
8
+ base_model:
9
+ - argilla/CapybaraHermes-2.5-Mistral-7B
10
+ - WizardLM/WizardMath-7B-V1.1
11
+ ---
12
+
13
+ # 試製-暮光-4x7B
14
+
15
+ 試製-暮光-7B 是用[LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing)融合以下模型生成的:
16
+ * [argilla/CapybaraHermes-2.5-Mistral-7B](https://huggingface.co/argilla/CapybaraHermes-2.5-Mistral-7B)
17
+ * [WizardLM/WizardMath-7B-V1.1](https://huggingface.co/WizardLM/WizardMath-7B-V1.1)
18
+
19
+ 這是一個實驗模型,目的是爲了檢驗套用在不同語言上的高品質模型調教是否能夠轉移(此模型爲英文到中文)。
20
+
21
+
22
+ # shizhi-twilight-7B
23
+
24
+ shizhi-twilight-7B is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
25
+ * [argilla/CapybaraHermes-2.5-Mistral-7B](https://huggingface.co/argilla/CapybaraHermes-2.5-Mistral-7B)
26
+ * [WizardLM/WizardMath-7B-V1.1](https://huggingface.co/WizardLM/WizardMath-7B-V1.1)
27
+
28
+ This is an experiment product on checking whether high quality fine-tuning on one language (English) could be transferred to another language (Mandarin) leveraging Slerp merge method.
29
+
30
+ ## 🧩 Configuration
31
+
32
+ ```yaml
33
+ models:
34
+ - model: MediaTek-Research/Breeze-7B-Instruct-v0_1
35
+ # No parameters necessary for base model
36
+ - model: argilla/CapybaraHermes-2.5-Mistral-7B
37
+ parameters:
38
+ density: 0.53
39
+ weight: 0.65
40
+ - model: WizardLM/WizardMath-7B-V1.1
41
+ parameters:
42
+ density: 0.53
43
+ weight: 0.35
44
+ merge_method: dare_ties
45
+ base_model: MediaTek-Research/Breeze-7B-Instruct-v0_1
46
+ parameters:
47
+ int8_mask: true
48
+ dtype: bfloat16
49
+ ```
50
+
51
+ ## 💻 Usage
52
+
53
+ ```python
54
+ !pip install -qU transformers accelerate
55
+
56
+ from transformers import AutoTokenizer
57
+ import transformers
58
+ import torch
59
+
60
+ model = "lipcut/shizhi-twilight-7B"
61
+ messages = [{"role": "user", "content": "什麼是大型語言模型?"}]
62
+
63
+ tokenizer = AutoTokenizer.from_pretrained(model)
64
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
65
+ pipeline = transformers.pipeline(
66
+ "text-generation",
67
+ model=model,
68
+ torch_dtype=torch.float16,
69
+ device_map="auto",
70
+ )
71
+
72
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
73
+ print(outputs[0]["generated_text"])
74
+ ```