Skip to content

Commit

Permalink
add cerebras api
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingWithTim committed Nov 6, 2024
1 parent 185e1a9 commit eb24fc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fastchat/serve/monitor/classify/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ task_name:
- creative_writing_v0.1

model_name: null
name: llama-3-70b-instruct
name: llama-3.1-70b
endpoints:
- api_base: null
api_key: null
- api_base: https://api.cerebras.ai/v1
api_key: CEREBRAS_API_KEY
parallel: 50
temperature: 0.0
max_token: 512
Expand Down
5 changes: 4 additions & 1 deletion fastchat/serve/monitor/classify/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def get_answer(

for category in categories:
conv = category.pre_process(question["prompt"])
start_time = time.time()
output = chat_completion_openai(
model=model_name,
messages=conv,
Expand All @@ -116,7 +117,9 @@ def get_answer(
api_dict=api_dict,
)
# Dump answers
category_tag[category.name_tag] = category.post_process(output)
category_tag[category.name_tag] = category.post_process(
output
) | {"completion_time": round(time.time() - start_time, 5)}

if testing:
output_log[category.name_tag] = output
Expand Down

0 comments on commit eb24fc6

Please sign in to comment.