migtissera commited on
Commit
41b5452
1 Parent(s): d0ffb40

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +164 -0
README.md CHANGED
@@ -1,3 +1,167 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ pipeline_tag: text-generation
4
+ language:
5
+ - en
6
+ library_name: transformers
7
  ---
8
+
9
+ Change from Synthia-7B-v1.2 -> Synthia-7B-v1.3: Base model was changed from LLaMA-2-7B to Mistral-7B-v0.1
10
+
11
+ All Synthia models are uncensored. Please use it with caution and with best intentions. You are responsible for how you use Synthia.
12
+
13
+ To evoke generalized Tree of Thought + Chain of Thought reasoning, you may use the following system message:
14
+ ```
15
+ 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.
16
+ ```
17
+
18
+ # Synthia-7B-v1.3
19
+ SynthIA (Synthetic Intelligent Agent) 7B-v1.3 is a Mistral-7B-v0.1 model trained on Orca style datasets. It has been fine-tuned for instruction following as well as having long-form conversations.
20
+
21
+ <br>
22
+
23
+ ![Synthia](https://huggingface.co/migtissera/Synthia-13B/resolve/main/Synthia.jpeg)
24
+
25
+ <br>
26
+
27
+ <br>
28
+
29
+ #### License Disclaimer:
30
+
31
+ This model is released under Apache 2.0, and comes with no warranty or gurantees of any kind.
32
+
33
+ <br>
34
+
35
+ ## Evaluation
36
+
37
+ We evaluated Synthia-7B-v1.3 on a wide range of tasks using [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) from EleutherAI.
38
+
39
+ Here are the results on metrics used by [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
40
+
41
+ ||||
42
+ |:------:|:--------:|:-------:|
43
+ |**Task**|**Metric**|**Value**|
44
+ |*arc_challenge*|acc_norm|0.6237|
45
+ |*hellaswag*|acc_norm|0.8349|
46
+ |*mmlu*|acc_norm|0.6232|
47
+ |*truthfulqa_mc*|mc2|0.5125|
48
+ |**Total Average**|-|**0.6485**||
49
+
50
+ <br>
51
+
52
+ ## Example Usage
53
+
54
+ ### Here is prompt format:
55
+
56
+ ```
57
+ 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.
58
+ USER: How is a rocket launched from the surface of the earth to Low Earth Orbit?
59
+ ASSISTANT:
60
+ ```
61
+
62
+ ### Below shows a code example on how to use this model:
63
+
64
+ ```python
65
+ import torch, json
66
+ from transformers import AutoModelForCausalLM, AutoTokenizer
67
+
68
+ model_path = "migtissera/Synthia-7B-v1.3"
69
+ output_file_path = "./Synthia-7B-conversations.jsonl"
70
+
71
+ model = AutoModelForCausalLM.from_pretrained(
72
+ model_path,
73
+ torch_dtype=torch.float16,
74
+ device_map="auto",
75
+ load_in_8bit=False,
76
+ trust_remote_code=True,
77
+ )
78
+
79
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
80
+
81
+
82
+ def generate_text(instruction):
83
+ tokens = tokenizer.encode(instruction)
84
+ tokens = torch.LongTensor(tokens).unsqueeze(0)
85
+ tokens = tokens.to("cuda")
86
+
87
+ instance = {
88
+ "input_ids": tokens,
89
+ "top_p": 1.0,
90
+ "temperature": 0.75,
91
+ "generate_len": 1024,
92
+ "top_k": 50,
93
+ }
94
+
95
+ length = len(tokens[0])
96
+ with torch.no_grad():
97
+ rest = model.generate(
98
+ input_ids=tokens,
99
+ max_length=length + instance["generate_len"],
100
+ use_cache=True,
101
+ do_sample=True,
102
+ top_p=instance["top_p"],
103
+ temperature=instance["temperature"],
104
+ top_k=instance["top_k"],
105
+ num_return_sequences=1,
106
+ )
107
+ output = rest[0][length:]
108
+ string = tokenizer.decode(output, skip_special_tokens=True)
109
+ answer = string.split("USER:")[0].strip()
110
+ return f"{answer}"
111
+
112
+
113
+ conversation = f"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."
114
+
115
+
116
+ while True:
117
+ user_input = input("You: ")
118
+ llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
119
+ answer = generate_text(llm_prompt)
120
+ print(answer)
121
+ conversation = f"{llm_prompt}{answer}"
122
+ json_data = {"prompt": user_input, "answer": answer}
123
+
124
+ ## Save your conversation
125
+ with open(output_file_path, "a") as output_file:
126
+ output_file.write(json.dumps(json_data) + "\n")
127
+
128
+ ```
129
+
130
+ <br>
131
+
132
+ #### Limitations & Biases:
133
+
134
+ While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
135
+
136
+ Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
137
+
138
+ Exercise caution and cross-check information when necessary. This is an uncensored model.
139
+
140
+
141
+ <br>
142
+
143
+ ### Citiation:
144
+
145
+ Please kindly cite using the following BibTeX:
146
+
147
+ ```
148
+ @misc{Synthia-7B-v1.3,
149
+ author = {Migel Tissera},
150
+ title = {Synthia-7B-v1.3: Synthetic Intelligent Agent},
151
+ year = {2023},
152
+ publisher = {GitHub, HuggingFace},
153
+ journal = {GitHub repository, HuggingFace repository},
154
+ howpublished = {\url{https://huggingface.co/migtissera/Synthia-13B},
155
+ }
156
+ ```
157
+
158
+ ```
159
+ @misc{mukherjee2023orca,
160
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
161
+ author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
162
+ year={2023},
163
+ eprint={2306.02707},
164
+ archivePrefix={arXiv},
165
+ primaryClass={cs.CL}
166
+ }
167
+ ```