Skip to content

Commit 5805c20

Browse files
thesofakillersJunShernianmckenzie-oai
authored
TogetherSolver (#1502)
This PR contributes a `TogetherSolver` class, a solver for using models served by the [Together AI API](https://docs.together.ai/docs/quickstart) Because [Together supports the OpenAI python sdk](https://docs.together.ai/docs/openai-api-compatibility), we simply create a subclass of the `OpenAISolver`, overriding some functionality. There is therefore some refactoring of the `OpenAISolver` included in this PR to facilitate this code sharing. At the moment, we support the models specified in `evals/registry/solvers/together.yaml`, but in principle most models offered from the Together AI API can easily be added Notes: - logit biasing not supported by the Together API due to a lack of a unified tokenizer a la [tiktoken](https://github.com/openai/tiktoken) from openai - For the same reason, checking for context length limits not supported Co-authored-by: Chan Jun Shern <[email protected]> Co-authored-by: Ian McKenzie <[email protected]>
1 parent e30e141 commit 5805c20

File tree

4 files changed

+554
-121
lines changed

4 files changed

+554
-121
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# --- Direct Solvers ---
2+
generation/direct/llama-2-13b-chat:
3+
class: evals.solvers.together_solver:TogetherSolver
4+
args:
5+
completion_fn_options:
6+
model: meta-llama/Llama-2-13b-chat-hf
7+
extra_options:
8+
temperature: 1
9+
max_tokens: 512
10+
postprocessors: &postprocessors
11+
- evals.solvers.postprocessors.postprocessors:Strip
12+
13+
generation/direct/llama-2-70b-chat:
14+
class: evals.solvers.together_solver:TogetherSolver
15+
args:
16+
completion_fn_options:
17+
model: meta-llama/Llama-2-70b-chat-hf
18+
extra_options:
19+
temperature: 1
20+
max_tokens: 512
21+
postprocessors: *postprocessors
22+
23+
generation/direct/mixtral-8x7b-instruct:
24+
class: evals.solvers.together_solver:TogetherSolver
25+
args:
26+
completion_fn_options:
27+
model: mistralai/Mixtral-8x7B-Instruct-v0.1
28+
extra_options:
29+
temperature: 1
30+
max_tokens: 512
31+
postprocessors: *postprocessors
32+
# --- COT Solvers ---
33+
34+
generation/cot/llama-2-13b-chat:
35+
class: evals.solvers.nested.cot_solver:CoTSolver
36+
args:
37+
cot_solver:
38+
class: evals.solvers.together_solver:TogetherSolver
39+
args:
40+
completion_fn_options:
41+
model: meta-llama/Llama-2-13b-chat-hf
42+
extra_options:
43+
temperature: 1
44+
max_tokens: 512
45+
extract_solver:
46+
class: evals.solvers.together_solver:TogetherSolver
47+
args:
48+
completion_fn_options:
49+
model: meta-llama/Llama-2-13b-chat-hf
50+
extra_options:
51+
temperature: 1
52+
max_tokens: 512
53+
54+
generation/cot/llama-2-70b-chat:
55+
class: evals.solvers.nested.cot_solver:CoTSolver
56+
args:
57+
cot_solver:
58+
class: evals.solvers.together_solver:TogetherSolver
59+
args:
60+
completion_fn_options:
61+
model: meta-llama/Llama-2-70b-chat-hf
62+
extra_options:
63+
temperature: 1
64+
max_tokens: 512
65+
extract_solver:
66+
class: evals.solvers.together_solver:TogetherSolver
67+
args:
68+
completion_fn_options:
69+
model: meta-llama/Llama-2-70b-chat-hf
70+
extra_options:
71+
temperature: 1
72+
max_tokens: 512
73+
74+
generation/cot/mixtral-8x7b-instruct:
75+
class: evals.solvers.nested.cot_solver:CoTSolver
76+
args:
77+
cot_solver:
78+
class: evals.solvers.together_solver:TogetherSolver
79+
args:
80+
completion_fn_options:
81+
model: mistralai/Mixtral-8x7B-Instruct-v0.1
82+
extra_options:
83+
temperature: 1
84+
max_tokens: 512
85+
extract_solver:
86+
class: evals.solvers.together_solver:TogetherSolver
87+
args:
88+
completion_fn_options:
89+
model: mistralai/Mixtral-8x7B-Instruct-v0.1
90+
extra_options:
91+
temperature: 1
92+
max_tokens: 512

0 commit comments

Comments
 (0)