Ubuntu commited on
Commit
d11f119
1 Parent(s): 74a31a4

first commit

Browse files
Files changed (1) hide show
  1. README.md +99 -0
README.md CHANGED
@@ -1,3 +1,102 @@
1
  ---
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
  ---
4
+
5
+ # Join My General AI Discord (NeuroLattice):
6
+ https://discord.gg/Hz6GrwGFKD
7
+
8
+ # Tess-2.0-Mixtral-8x22B
9
+ Tess, short for Tesoro (Treasure in Italian), is a general purpose Large Language Model series. Tess-2.0-Mixtral-8x22B was trained on the mistral-community/Mixtral-8x22B-v0.1 base.
10
+
11
+ # Prompt Format
12
+
13
+ ```
14
+ SYSTEM: <ANY SYSTEM CONTEXT>
15
+ USER:
16
+ ASSISTANT:
17
+ ```
18
+
19
+ # Training Methodology
20
+ Tess-2.0-Mixtral-8x22B was trained on the Tess-2.0 dataset. Tess-2.0 dataset and the training methodology follows LIMA (Less-Is-More) principles, and contains ~25K high-quality code and general training samples. The dataset is highly uncensored, hence the model will almost always follow instructions.
21
+
22
+ The model was only fine-tuned for 1-epoch to try and preserve its entropy as much as possible.
23
+
24
+
25
+ # Sample code to run inference
26
+
27
+ ```python
28
+ import torch, json
29
+ from transformers import AutoModelForCausalLM, AutoTokenizer
30
+
31
+ model_path = "migtissera/Tess-2.0-Mixtral-8x22B"
32
+ output_file_path = "./conversations.jsonl"
33
+
34
+ model = AutoModelForCausalLM.from_pretrained(
35
+ model_path,
36
+ torch_dtype=torch.float16,
37
+ device_map="auto",
38
+ load_in_8bit=False,
39
+ trust_remote_code=True,
40
+ )
41
+
42
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
43
+
44
+
45
+ def generate_text(instruction):
46
+ tokens = tokenizer.encode(instruction)
47
+ tokens = torch.LongTensor(tokens).unsqueeze(0)
48
+ tokens = tokens.to("cuda")
49
+
50
+ instance = {
51
+ "input_ids": tokens,
52
+ "top_p": 1.0,
53
+ "temperature": 0.5,
54
+ "generate_len": 1024,
55
+ "top_k": 50,
56
+ }
57
+
58
+ length = len(tokens[0])
59
+ with torch.no_grad():
60
+ rest = model.generate(
61
+ input_ids=tokens,
62
+ max_length=length + instance["generate_len"],
63
+ use_cache=True,
64
+ do_sample=True,
65
+ top_p=instance["top_p"],
66
+ temperature=instance["temperature"],
67
+ top_k=instance["top_k"],
68
+ num_return_sequences=1,
69
+ )
70
+ output = rest[0][length:]
71
+ string = tokenizer.decode(output, skip_special_tokens=True)
72
+ answer = string.split("USER:")[0].strip()
73
+ return f"{answer}"
74
+
75
+
76
+ conversation = f"SYSTEM: Answer the question thoughtfully and intelligently. Always answer without hesitation."
77
+
78
+
79
+ while True:
80
+ user_input = input("You: ")
81
+ llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
82
+ answer = generate_text(llm_prompt)
83
+ print(answer)
84
+ conversation = f"{llm_prompt}{answer}"
85
+ json_data = {"prompt": user_input, "answer": answer}
86
+
87
+ ## Save your conversation
88
+ with open(output_file_path, "a") as output_file:
89
+ output_file.write(json.dumps(json_data) + "\n")
90
+
91
+ ```
92
+
93
+
94
+
95
+ # Limitations & Biases:
96
+
97
+ While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
98
+
99
+ Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
100
+
101
+ Exercise caution and cross-check information when necessary. This is an uncensored model.
102
+