Isotonic commited on
Commit
ff1cd0a
1 Parent(s): 6bb99ab

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -65
README.md CHANGED
@@ -16,74 +16,12 @@ TinyQwex-4x620M-MoE is a Mixure of Experts (MoE) made with the following models
16
  * [Qwen/Qwen1.5-0.5B](https://huggingface.co/Qwen/Qwen1.5-0.5B)
17
  * [Qwen/Qwen1.5-0.5B](https://huggingface.co/Qwen/Qwen1.5-0.5B)
18
 
19
- ## 🧩 Configuration
20
-
21
- ```yamlbase_model: Qwen/Qwen1.5-0.5B
22
- experts:
23
- - source_model: Qwen/Qwen1.5-0.5B
24
- positive_prompts:
25
- - "reasoning"
26
- - "logic"
27
- - "problem-solving"
28
- - "critical thinking"
29
- - "analysis"
30
- - "synthesis"
31
- - "evaluation"
32
- - "decision-making"
33
- - "judgment"
34
- - "insight"
35
 
36
- - source_model: Qwen/Qwen1.5-0.5B
37
- positive_prompts:
38
- - "program"
39
- - "software"
40
- - "develop"
41
- - "build"
42
- - "create"
43
- - "design"
44
- - "implement"
45
- - "debug"
46
- - "test"
47
- - "code"
48
- - "python"
49
- - "programming"
50
- - "algorithm"
51
- - "function"
52
-
53
- - source_model: Qwen/Qwen1.5-0.5B
54
- positive_prompts:
55
- - "storytelling"
56
- - "narrative"
57
- - "fiction"
58
- - "creative writing"
59
- - "plot"
60
- - "characters"
61
- - "dialogue"
62
- - "setting"
63
- - "emotion"
64
- - "imagination"
65
- - "scene"
66
- - "story"
67
- - "character"
68
-
69
- - source_model: Qwen/Qwen1.5-0.5B
70
- positive_prompts:
71
- - "chat"
72
- - "conversation"
73
- - "dialogue"
74
- - "discuss"
75
- - "ask questions"
76
- - "share thoughts"
77
- - "explore ideas"
78
- - "learn new things"
79
- - "personal assistant"
80
- - "friendly helper"
81
- ```
82
 
83
  ## 💻 Usage
84
 
85
  ```python
86
- !pip install -qU transformers bitsandbytes accelerate
87
 
88
  from transformers import AutoTokenizer
89
  import transformers
@@ -91,15 +29,36 @@ import torch
91
 
92
  model = "Isotonic/TinyQwex-4x620M-MoE"
93
 
94
- tokenizer = AutoTokenizer.from_pretrained(model)
95
  pipeline = transformers.pipeline(
96
  "text-generation",
97
  model=model,
98
- model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
99
  )
100
 
101
  messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
102
  prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
103
  outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
104
  print(outputs[0]["generated_text"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  ```
 
16
  * [Qwen/Qwen1.5-0.5B](https://huggingface.co/Qwen/Qwen1.5-0.5B)
17
  * [Qwen/Qwen1.5-0.5B](https://huggingface.co/Qwen/Qwen1.5-0.5B)
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  ## 💻 Usage
22
 
23
  ```python
24
+ !pip install -qU transformers bitsandbytes accelerate eniops
25
 
26
  from transformers import AutoTokenizer
27
  import transformers
 
29
 
30
  model = "Isotonic/TinyQwex-4x620M-MoE"
31
 
32
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen1.5-0.5B")
33
  pipeline = transformers.pipeline(
34
  "text-generation",
35
  model=model,
36
+ model_kwargs={"torch_dtype": torch.bfloat16, "load_in_4bit": True},
37
  )
38
 
39
  messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
40
  prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
41
  outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
42
  print(outputs[0]["generated_text"])
43
+ ```
44
+
45
+ ## 🧩 Configuration
46
+
47
+ ```yamlbase_model: Qwen/Qwen1.5-0.5B
48
+ experts:
49
+ - source_model: Qwen/Qwen1.5-0.5B
50
+ positive_prompts:
51
+ - "reasoning"
52
+
53
+ - source_model: Qwen/Qwen1.5-0.5B
54
+ positive_prompts:
55
+ - "program"
56
+
57
+ - source_model: Qwen/Qwen1.5-0.5B
58
+ positive_prompts:
59
+ - "storytelling"
60
+
61
+ - source_model: Qwen/Qwen1.5-0.5B
62
+ positive_prompts:
63
+ - "Instruction following assistant"
64
  ```