Skip to content

Commit eb24fc6

Browse files
committed
add cerebras api
1 parent 185e1a9 commit eb24fc6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

fastchat/serve/monitor/classify/config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ task_name:
1313
- creative_writing_v0.1
1414

1515
model_name: null
16-
name: llama-3-70b-instruct
16+
name: llama-3.1-70b
1717
endpoints:
18-
- api_base: null
19-
api_key: null
18+
- api_base: https://api.cerebras.ai/v1
19+
api_key: CEREBRAS_API_KEY
2020
parallel: 50
2121
temperature: 0.0
2222
max_token: 512

fastchat/serve/monitor/classify/label.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def get_answer(
108108

109109
for category in categories:
110110
conv = category.pre_process(question["prompt"])
111+
start_time = time.time()
111112
output = chat_completion_openai(
112113
model=model_name,
113114
messages=conv,
@@ -116,7 +117,9 @@ def get_answer(
116117
api_dict=api_dict,
117118
)
118119
# Dump answers
119-
category_tag[category.name_tag] = category.post_process(output)
120+
category_tag[category.name_tag] = category.post_process(
121+
output
122+
) | {"completion_time": round(time.time() - start_time, 5)}
120123

121124
if testing:
122125
output_log[category.name_tag] = output

0 commit comments

Comments
 (0)