Skip to content

Commit

Permalink
revert bad black config
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacker committed Oct 30, 2023
1 parent f7fe1b0 commit 31209c6
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions memgpt/openai_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def wrapper(*args, **kwargs):

# Check if max retries has been reached
if num_retries > max_retries:
raise Exception(
f"Maximum number of retries ({max_retries}) exceeded."
)
raise Exception(f"Maximum number of retries ({max_retries}) exceeded.")

# Increment the delay
delay *= exponential_base * (1 + jitter * random.random())
Expand Down Expand Up @@ -91,9 +89,7 @@ async def wrapper(*args, **kwargs):

# Check if max retries has been reached
if num_retries > max_retries:
raise Exception(
f"Maximum number of retries ({max_retries}) exceeded."
)
raise Exception(f"Maximum number of retries ({max_retries}) exceeded.")

# Increment the delay
delay *= exponential_base * (1 + jitter * random.random())
Expand Down Expand Up @@ -203,9 +199,7 @@ def configure_azure_support():
azure_openai_endpoint,
azure_openai_version,
]:
print(
f"Error: missing Azure OpenAI environment variables. Please see README section on Azure."
)
print(f"Error: missing Azure OpenAI environment variables. Please see README section on Azure.")
return

openai.api_type = "azure"
Expand All @@ -218,10 +212,7 @@ def configure_azure_support():
def check_azure_embeddings():
azure_openai_deployment = os.getenv("AZURE_OPENAI_DEPLOYMENT")
azure_openai_embedding_deployment = os.getenv("AZURE_OPENAI_EMBEDDING_DEPLOYMENT")
if (
azure_openai_deployment is not None
and azure_openai_embedding_deployment is None
):
if azure_openai_deployment is not None and azure_openai_embedding_deployment is None:
raise ValueError(
f"Error: It looks like you are using Azure deployment ids and computing embeddings, make sure you are setting one for embeddings as well. Please see README section on Azure"
)

0 comments on commit 31209c6

Please sign in to comment.