NBLM / config /config.py
youngtsai's picture
def generate_transcript(youtube_link):
9b4503a
raw
history blame
617 Bytes
import os
import json
# KEY CONFIG
is_env_local = os.getenv("IS_ENV_LOCAL", "false") == "true"
print(f"is_env_local: {is_env_local}")
print("===gr__version__===")
print(gr.__version__)
if is_env_local:
with open("local_config.json") as f:
config = json.load(f)
IS_ENV_PROD = "False"
PASSWORD = config["PASSWORD"]
GOOGLE_CREDENTIALS_KEY = json.dumps(config["GOOGLE_APPLICATION_CREDENTIALS_JSON"])
else:
IS_ENV_PROD = os.getenv("IS_ENV_PROD", "False")
PASSWORD = os.getenv("PASSWORD")
GOOGLE_CREDENTIALS_KEY = os.getenv("GOOGLE_APPLICATION_CREDENTIALS_JSON")