add config

This commit is contained in:
ishaan-jaff 2023-08-11 10:18:12 -07:00
parent fb285c8c9f
commit 27cc3760b7
5 changed files with 48 additions and 3 deletions

View file

@ -709,3 +709,19 @@ class CustomStreamWrapper:
completion_obj["content"] = chunk.text
# return this for all models
return {"choices": [{"delta": completion_obj}]}
########## Reading Config File ############################
def read_config_args(config_path):
try:
import os
current_path = os.getcwd()
with open(config_path, "r") as config_file:
config = json.load(config_file)
# read keys/ values from config file and return them
return config
except Exception as e:
print("An error occurred while reading config:", str(e))
raise e