cloudyu commited on
Commit
710e699
·
1 Parent(s): c490e24

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -0
README.md ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ ---
4
+
5
+ MoE of the following models by mergekit:
6
+
7
+ * [Undi95/Xwin-MLewd-13B-V0.2](https://huggingface.co/Undi95/Xwin-MLewd-13B-V0.2)
8
+ * [NurtureAI/Undi95/Utopia-13B](https://huggingface.co/Undi95/Utopia-13B)
9
+ * [meta-math/mncai/KoboldAI/LLaMA2-13B-Psyfighter2](https://huggingface.co/KoboldAI/LLaMA2-13B-Psyfighter2)
10
+
11
+ MoE setting:
12
+ base_model: Undi95/Xwin-MLewd-13B-V0.2
13
+ experts:
14
+ - source_model: Undi95/Utopia-13B
15
+ positive_prompts:
16
+ - "sex"
17
+ - "roleplay"
18
+ - "erotic"
19
+ - "fuck"
20
+ - "orgasm"
21
+ - "uncensored"
22
+ - "chat"
23
+ - "[Mode: Roleplay]"
24
+ - "[Mode: Chat]"
25
+ negative_prompts:
26
+ - "storywriting"
27
+ - "book"
28
+ - "story"
29
+ - "chapter"
30
+ - "[Mode: Mathematics]"
31
+ - source_model: KoboldAI/LLaMA2-13B-Psyfighter2
32
+ positive_prompts:
33
+ - "writing"
34
+ - "write"
35
+ - "book"
36
+ - "story"
37
+ - "erotic"
38
+ - "chapter"
39
+ - "tale"
40
+ - "[Mode: Storywriting]"
41
+ negative_prompts:
42
+ - "[Mode: Roleplay]"
43
+ - "[Mode: Chat]"
44
+ - "[Mode: Mathematics]"
45
+ - "chat"
46
+ - "roleplay"
47
+
48
+
49
+
50
+
51
+
52
+ gpu code example
53
+
54
+ ```
55
+ import torch
56
+ from transformers import AutoTokenizer, AutoModelForCausalLM
57
+ import math
58
+
59
+ ## v2 models
60
+ model_path = "Mixtral_Erotic_13Bx2_MOE_22B"
61
+
62
+ tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
63
+ model = AutoModelForCausalLM.from_pretrained(
64
+ model_path, torch_dtype=torch.float32, device_map='auto',local_files_only=False, load_in_4bit=True
65
+ )
66
+ print(model)
67
+ prompt = input("please input prompt:")
68
+ while len(prompt) > 0:
69
+ input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
70
+
71
+ generation_output = model.generate(
72
+ input_ids=input_ids, max_new_tokens=500,repetition_penalty=1.2
73
+ )
74
+ print(tokenizer.decode(generation_output[0]))
75
+ prompt = input("please input prompt:")
76
+ ```
77
+
78
+ CPU example
79
+
80
+ ```
81
+ import torch
82
+ from transformers import AutoTokenizer, AutoModelForCausalLM
83
+ import math
84
+
85
+ ## v2 models
86
+ model_path = "Mixtral_Erotic_13Bx2_MOE_22B"
87
+
88
+ tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
89
+ model = AutoModelForCausalLM.from_pretrained(
90
+ model_path, torch_dtype=torch.float32, device_map='cpu',local_files_only=False
91
+ )
92
+ print(model)
93
+ prompt = input("please input prompt:")
94
+ while len(prompt) > 0:
95
+ input_ids = tokenizer(prompt, return_tensors="pt").input_ids
96
+
97
+ generation_output = model.generate(
98
+ input_ids=input_ids, max_new_tokens=500,repetition_penalty=1.2
99
+ )
100
+ print(tokenizer.decode(generation_output[0]))
101
+ prompt = input("please input prompt:")
102
+
103
+ ```