Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieHwong committed Apr 19, 2024
1 parent 21a5cba commit a4ef9d7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions trustllm_pkg/trustllm/utils/generation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,13 @@ def deepinfra_api(string, model, temperature):

top_p = 1 if temperature <= 1e-5 else 0.9

OpenAI(api_key=api_token,api_base="https://api.deepinfra.com/v1/openai")
client = OpenAI(api_key=api_token,api_base="https://api.deepinfra.com/v1/openai")
stream = client.chat.completions.create(
model=rev_model_mapping[model],
messages=[{"role": "user", "content": string}],
max_tokens=5192,max_tokens=5192,
max_tokens=5192,
temperature=temperature,
top_p=top_p,
temperature=temperature,)
top_p=top_p,)
response = stream.choices[0].message.content
return response

Expand Down

0 comments on commit a4ef9d7

Please sign in to comment.