Skip to content

Commit

Permalink
minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
bsabri committed Sep 25, 2023
1 parent ff163cb commit a74f75a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions llmebench/models/FastChat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

class FastChatModel(OpenAIModel):
def __init__(self, api_base=None, api_key=None, model_name=None, **kwargs):
self.api_base = api_base or os.getenv("OPENAI_API_BASE")
self.api_key = api_key or os.getenv("OPENAI_API_KEY")
self.model_name = model_name or os.getenv("OPENAI_MODEL")
if self.api_base is None:
api_base = api_base or os.getenv("OPENAI_API_BASE")
api_key = api_key or os.getenv("OPENAI_API_KEY")
model_name = model_name or os.getenv("OPENAI_MODEL")
if api_base is None:
raise Exception(
"API url must be provided as model config or environment variable (`OPENAI_API_BASE`)"
)
if self.api_key is None:
if api_key is None:
raise Exception(
"API url must be provided as model config or environment variable (`OPENAI_API_KEY`)"
)
if self.model_name is None:
if model_name is None:
raise Exception(
"API url must be provided as model config or environment variable (`OPENAI_MODEL`)"
)
Expand Down

0 comments on commit a74f75a

Please sign in to comment.