forked from ScalingIntelligence/Archon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquickstart.py
72 lines (64 loc) · 1.81 KB
/
quickstart.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from archon.completions import Archon
# make sure to set your OPENAI_API_KEY environment variable
# Initialize Archon
single_gpt_config = {
"name": "gpt-4o-single",
"layers": [
[
{
"type": "generator",
"model": "gpt-4o",
"model_type": "OpenAI_API",
"top_k": 1,
"temperature": 0.7,
"max_tokens": 2048,
"samples": 1,
}
]
],
}
archon_gpt_config = {
"name": "archon-gpt-multi-model",
"layers": [
[
{
"type": "generator",
"model": "gpt-4o",
"model_type": "OpenAI_API",
"top_k": 1,
"temperature": 0.7,
"max_tokens": 2048,
"samples": 10,
}
],
[
{
"type": "ranker",
"model": "gpt-4o",
"model_type": "OpenAI_API",
"top_k": 5,
"temperature": 0.7,
"max_tokens": 2048,
}
],
[
{
"type": "fuser",
"model": "gpt-4o",
"model_type": "OpenAI_API",
"temperature": 0.7,
"max_tokens": 2048,
"samples": 1,
}
],
],
}
#################################################
single_gpt = Archon(single_gpt_config)
archon_gpt = Archon(archon_gpt_config)
testing_instruction = [{"role": "user", "content": "How do I make a cake?"}]
single_gpt_response = single_gpt.generate(testing_instruction)
archon_gpt_response = archon_gpt.generate(testing_instruction)
print(f"Single GPT Query: {single_gpt_response}")
print("---------------------")
print(f"Archon GPT: {archon_gpt_response}")