alantcoding commited on
Commit
c9ff272
·
verified ·
1 Parent(s): 038b0a6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +65 -0
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - NousResearch/Hermes-2-Pro-Mistral-7B
4
+ - mistralai/Mistral-7B-Instruct-v0.2
5
+ tags:
6
+ - merge
7
+ - mergekit
8
+ - lazymergekit
9
+ - NousResearch/Hermes-2-Pro-Mistral-7B
10
+ - mistralai/Mistral-7B-Instruct-v0.2
11
+ ---
12
+
13
+ # TranscriptAnalyzer-7B
14
+
15
+ TranscriptAnalyzer-7B is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
16
+ * [NousResearch/Hermes-2-Pro-Mistral-7B](https://huggingface.co/NousResearch/Hermes-2-Pro-Mistral-7B)
17
+ * [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)
18
+
19
+ ## 🧩 Configuration
20
+
21
+ ```yaml
22
+ base_model: mistralai/Mistral-7B-v0.1
23
+ dtype: float16
24
+ merge_method: dare_ties
25
+ parameters:
26
+ density: 0.6 # Optimal pour 2 modèles
27
+
28
+ slices:
29
+ - sources:
30
+ - model: NousResearch/Hermes-2-Pro-Mistral-7B
31
+ layer_range: [0, 32]
32
+ parameters:
33
+ weight: 0.65 # 65% Hermes (analyse)
34
+ density: 0.7
35
+ - model: mistralai/Mistral-7B-Instruct-v0.2
36
+ layer_range: [0, 32]
37
+ parameters:
38
+ weight: 0.35 # 35% Mistral (rapidité)
39
+ density: 0.6
40
+ ```
41
+
42
+ ## 💻 Usage
43
+
44
+ ```python
45
+ !pip install -qU transformers accelerate
46
+
47
+ from transformers import AutoTokenizer
48
+ import transformers
49
+ import torch
50
+
51
+ model = "alantcoding/TranscriptAnalyzer-7B"
52
+ messages = [{"role": "user", "content": "What is a large language model?"}]
53
+
54
+ tokenizer = AutoTokenizer.from_pretrained(model)
55
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
56
+ pipeline = transformers.pipeline(
57
+ "text-generation",
58
+ model=model,
59
+ torch_dtype=torch.float16,
60
+ device_map="auto",
61
+ )
62
+
63
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
64
+ print(outputs[0]["generated_text"])
65
+ ```