refactor: add black formatting

This commit is contained in:
Krrish Dholakia 2023-12-25 14:10:38 +05:30
parent b87d630b0a
commit 4905929de3
156 changed files with 19723 additions and 10869 deletions

View file

@ -4,24 +4,20 @@ import uuid
import traceback
litellm_client = AsyncOpenAI(
api_key="test",
base_url="http://0.0.0.0:8000"
)
litellm_client = AsyncOpenAI(api_key="test", base_url="http://0.0.0.0:8000")
async def litellm_completion():
# Your existing code for litellm_completion goes here
try:
print("starting embedding calls")
response = await litellm_client.embeddings.create(
response = await litellm_client.embeddings.create(
model="text-embedding-ada-002",
input = [
"hello who are you" * 2000,
input=[
"hello who are you" * 2000,
"hello who are you tomorrow 1234" * 1000,
"hello who are you tomorrow 1234" * 1000
]
"hello who are you tomorrow 1234" * 1000,
],
)
print(response)
return response
@ -31,7 +27,6 @@ async def litellm_completion():
with open("error_log.txt", "a") as error_log:
error_log.write(f"Error during completion: {str(e)}\n")
pass
async def main():
@ -51,6 +46,7 @@ async def main():
print(n, time.time() - start, len(successful_completions))
if __name__ == "__main__":
# Blank out contents of error_log.txt
open("error_log.txt", "w").close()