Views
No views yet
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.
| Task | Metric | Value |
| arc_challenge | acc_norm | 54.35 |
| hellaswag | acc_norm | 79.29 |
| mmlu | acc_norm | 49.33 |
| truthfulqa_mc | mc2 | 48.92 |
| Total Average | - | 57.97 |
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.
USER: How is a rocket launched from the surface of the earth to Low Earth Orbit?
ASSISTANT:1import torch, json
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_path = "migtissera/Synthia-7B-v1.2"
5output_file_path = "./Synthia-7B-conversations.jsonl"
6
7model = AutoModelForCausalLM.from_pretrained(
8 model_path,
9 torch_dtype=torch.float16,
10 device_map="auto",
11 load_in_8bit=False,
12 trust_remote_code=True,
13)
14
15tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
16
17
18def generate_text(instruction):
19 tokens = tokenizer.encode(instruction)
20 tokens = torch.LongTensor(tokens).unsqueeze(0)
21 tokens = tokens.to("cuda")
22
23 instance = {
24 "input_ids": tokens,
25 "top_p": 1.0,
26 "temperature": 0.75,
27 "generate_len": 1024,
28 "top_k": 50,
29 }
30
31 length = len(tokens[0])
32 with torch.no_grad():
33 rest = model.generate(
34 input_ids=tokens,
35 max_length=length + instance["generate_len"],
36 use_cache=True,
37 do_sample=True,
38 top_p=instance["top_p"],
39 temperature=instance["temperature"],
40 top_k=instance["top_k"],
41 num_return_sequences=1,
42 )
43 output = rest[0][length:]
44 string = tokenizer.decode(output, skip_special_tokens=True)
45 answer = string.split("USER:")[0].strip()
46 return f"{answer}"
47
48
49conversation = 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."
50
51
52while True:
53 user_input = input("You: ")
54 llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
55 answer = generate_text(llm_prompt)
56 print(answer)
57 conversation = f"{llm_prompt}{answer}"
58 json_data = {"prompt": user_input, "answer": answer}
59
60 ## Save your conversation
61 with open(output_file_path, "a") as output_file:
62 output_file.write(json.dumps(json_data) + "\n")
63@misc{Synthia-7B-v1.2,
author = {Migel Tissera},
title = {Synthia-70B-v1.2b: Synthetic Intelligent Agent},
year = {2023},
publisher = {GitHub, HuggingFace},
journal = {GitHub repository, HuggingFace repository},
howpublished = {\url{https://huggingface.co/migtissera/Synthia-13B},
}@misc{mukherjee2023orca,
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
year={2023},
eprint={2306.02707},
archivePrefix={arXiv},
primaryClass={cs.CL}
}@software{touvron2023llama,
title={LLaMA2: Open and Efficient Foundation Language Models},
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},
journal={arXiv preprint arXiv:2302.13971},
year={2023}
}| Metric | Value |
|---|---|
| Avg. | 47.5 |
| ARC (25-shot) | 54.35 |
| HellaSwag (10-shot) | 79.29 |
| MMLU (5-shot) | 49.33 |
| TruthfulQA (0-shot) | 48.92 |
| Winogrande (5-shot) | 73.56 |
| GSM8K (5-shot) | 10.84 |
| DROP (3-shot) | 16.24 |