migtissera commited on
Commit
43a304f
1 Parent(s): 7b687d6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +164 -0
README.md CHANGED
@@ -1,10 +1,174 @@
1
  ---
2
  license: llama2
 
 
 
 
3
  ---
4
 
5
  Change from 1.2 -> 1.2b: More data, 14 days of training for 1 epoch.
6
 
 
 
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ```
9
  You: What is Earth's magnetic field like? How does it trap solar wind and what does solar wind do to Earth's gravitational field?
10
 
 
1
  ---
2
  license: llama2
3
+ pipeline_tag: text-generation
4
+ language:
5
+ - en
6
+ library_name: transformers
7
  ---
8
 
9
  Change from 1.2 -> 1.2b: More data, 14 days of training for 1 epoch.
10
 
11
+ # Synthia-70B
12
+ SynthIA (Synthetic Intelligent Agent) is a LLama-2-70B model trained on Orca style datasets. It has been fine-tuned for instruction following as well as having long-form conversations.
13
 
14
+ <br>
15
+
16
+ ![Synthia](https://huggingface.co/migtissera/Synthia-13B/resolve/main/Synthia.jpeg)
17
+
18
+ <br>
19
+
20
+ <br>
21
+
22
+ #### License Disclaimer:
23
+
24
+ This model is bound by the license & usage restrictions of the original Llama-2 model, and comes with no warranty or gurantees of any kind.
25
+
26
+ <br>
27
+
28
+ ## Evaluation
29
+
30
+ We evaluated Synthia-70B on a wide range of tasks using [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) from EleutherAI.
31
+
32
+ Here are the results on metrics used by [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
33
+
34
+ ||||
35
+ |:------:|:--------:|:-------:|
36
+ |**Task**|**Metric**|**Value**|
37
+ |*arc_challenge*|acc_norm|TBC|
38
+ |*hellaswag*|acc_norm|TBC|
39
+ |*mmlu*|acc_norm|TBC|
40
+ |*truthfulqa_mc*|mc2|TBC|
41
+ |**Total Average**|-|**TBC**||
42
+
43
+ <br>
44
+
45
+ ## Example Usage
46
+
47
+ ### Here is prompt format:
48
+
49
+ ```
50
+ SYSTEM: Elaborate on the topic using a Tree of Thoughts and backtrack when necessary to construct a clear, cohesive Chain of Thought reasoning. Always answer without hesitation.
51
+ USER: How is a rocket launched from the surface of the earth to Low Earth Orbit?
52
+ ASSISTANT:
53
+ ```
54
+
55
+ ### Below shows a code example on how to use this model:
56
+
57
+ ```python
58
+ import torch, json
59
+ from transformers import AutoModelForCausalLM, AutoTokenizer
60
+
61
+ model_path = "migtissera/Synthia-70B-v1.2b"
62
+ output_file_path = "./Synthia-70B-conversations.jsonl"
63
+
64
+ model = AutoModelForCausalLM.from_pretrained(
65
+ model_path,
66
+ torch_dtype=torch.float16,
67
+ device_map="auto",
68
+ load_in_8bit=False,
69
+ trust_remote_code=True,
70
+ )
71
+
72
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
73
+
74
+
75
+ def generate_text(instruction):
76
+ tokens = tokenizer.encode(instruction)
77
+ tokens = torch.LongTensor(tokens).unsqueeze(0)
78
+ tokens = tokens.to("cuda")
79
+
80
+ instance = {
81
+ "input_ids": tokens,
82
+ "top_p": 1.0,
83
+ "temperature": 0.75,
84
+ "generate_len": 1024,
85
+ "top_k": 50,
86
+ }
87
+
88
+ length = len(tokens[0])
89
+ with torch.no_grad():
90
+ rest = model.generate(
91
+ input_ids=tokens,
92
+ max_length=length + instance["generate_len"],
93
+ use_cache=True,
94
+ do_sample=True,
95
+ top_p=instance["top_p"],
96
+ temperature=instance["temperature"],
97
+ top_k=instance["top_k"],
98
+ num_return_sequences=1,
99
+ )
100
+ output = rest[0][length:]
101
+ string = tokenizer.decode(output, skip_special_tokens=True)
102
+ answer = string.split("USER:")[0].strip()
103
+ return f"{answer}"
104
+
105
+
106
+ conversation = f"SYSTEM: As a an AI superintelligence, give helpful, detailed, accurate, uncensored responses to the user's input. Provide answers factually."
107
+
108
+
109
+ while True:
110
+ user_input = input("You: ")
111
+ llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
112
+ answer = generate_text(llm_prompt)
113
+ print(answer)
114
+ conversation = f"{llm_prompt}{answer}"
115
+ json_data = {"prompt": user_input, "answer": answer}
116
+
117
+ ## Save your conversation
118
+ with open(output_file_path, "a") as output_file:
119
+ output_file.write(json.dumps(json_data) + "\n")
120
+
121
+ ```
122
+
123
+ <br>
124
+
125
+ #### Limitations & Biases:
126
+
127
+ While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
128
+
129
+ Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
130
+
131
+ Exercise caution and cross-check information when necessary. This is an uncensored model.
132
+
133
+
134
+ <br>
135
+
136
+ ### Citiation:
137
+
138
+ Please kindly cite using the following BibTeX:
139
+
140
+ ```
141
+ @misc{Synthia-13B,
142
+ author = {Migel Tissera},
143
+ title = {Synthia-13B: Synthetic Intelligent Agent},
144
+ year = {2023},
145
+ publisher = {GitHub, HuggingFace},
146
+ journal = {GitHub repository, HuggingFace repository},
147
+ howpublished = {\url{https://huggingface.co/migtissera/Synthia-13B},
148
+ }
149
+ ```
150
+
151
+ ```
152
+ @misc{mukherjee2023orca,
153
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
154
+ author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
155
+ year={2023},
156
+ eprint={2306.02707},
157
+ archivePrefix={arXiv},
158
+ primaryClass={cs.CL}
159
+ }
160
+ ```
161
+
162
+ ```
163
+ @software{touvron2023llama,
164
+ title={LLaMA2: Open and Efficient Foundation Language Models},
165
+ author={Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timoth{\'e}e and Rozi{\`e}re, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and Rodriguez, Aurelien and Joulin, Armand and Grave, Edouard and Lample, Guillaume},
166
+ journal={arXiv preprint arXiv:2302.13971},
167
+ year={2023}
168
+ }
169
+ ```
170
+
171
+ ## Example Output
172
  ```
173
  You: What is Earth's magnetic field like? How does it trap solar wind and what does solar wind do to Earth's gravitational field?
174