From a3537f4a4d1f11871ce37048a05b126720d31916 Mon Sep 17 00:00:00 2001 From: Tom Chapin Date: Sat, 10 Feb 2024 19:53:55 -0800 Subject: [PATCH] adding python-dotenv --- OS/01/device.py | 3 +++ OS/01/i.py | 3 +++ OS/01/llm.py | 3 +++ OS/01/run.py | 4 ++++ OS/01/server.py | 3 +++ OS/01/stt.py | 3 +++ OS/01/tts.py | 3 +++ OS/01/utils/kernel.py | 3 +++ OS/01/utils/logs.py | 3 +++ 9 files changed, 28 insertions(+) diff --git a/OS/01/device.py b/OS/01/device.py index 6a1e24f..eb03cdd 100644 --- a/OS/01/device.py +++ b/OS/01/device.py @@ -1,3 +1,6 @@ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + import asyncio import threading import os diff --git a/OS/01/i.py b/OS/01/i.py index 339298f..0c24c49 100644 --- a/OS/01/i.py +++ b/OS/01/i.py @@ -1,3 +1,6 @@ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + import os import glob import json diff --git a/OS/01/llm.py b/OS/01/llm.py index 49a39bc..ba761a3 100644 --- a/OS/01/llm.py +++ b/OS/01/llm.py @@ -1,3 +1,6 @@ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + import os import subprocess from pathlib import Path diff --git a/OS/01/run.py b/OS/01/run.py index 44a365b..f3a558e 100644 --- a/OS/01/run.py +++ b/OS/01/run.py @@ -2,6 +2,10 @@ Exposes a SSE streaming server endpoint at /run, which recieves language and code, and streams the output. """ + +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + import os import json from interpreter import interpreter diff --git a/OS/01/server.py b/OS/01/server.py index 5986c48..cc6cbc9 100644 --- a/OS/01/server.py +++ b/OS/01/server.py @@ -1,3 +1,6 @@ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + from starlette.websockets import WebSocketDisconnect import ast import json diff --git a/OS/01/stt.py b/OS/01/stt.py index aa14e24..48a6494 100644 --- a/OS/01/stt.py +++ b/OS/01/stt.py @@ -2,6 +2,9 @@ Defines a function which takes a path to an audio file and turns it into text. """ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + from datetime import datetime import os import contextlib diff --git a/OS/01/tts.py b/OS/01/tts.py index e51972a..9093c51 100644 --- a/OS/01/tts.py +++ b/OS/01/tts.py @@ -2,6 +2,9 @@ Defines a function which takes text and returns a path to an audio file. """ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + import tempfile from openai import OpenAI from pydub import AudioSegment diff --git a/OS/01/utils/kernel.py b/OS/01/utils/kernel.py index 7f1bb3c..994e6fb 100644 --- a/OS/01/utils/kernel.py +++ b/OS/01/utils/kernel.py @@ -1,3 +1,6 @@ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + import asyncio import subprocess import platform diff --git a/OS/01/utils/logs.py b/OS/01/utils/logs.py index a73dea1..5aca8bb 100644 --- a/OS/01/utils/logs.py +++ b/OS/01/utils/logs.py @@ -1,3 +1,6 @@ +from dotenv import load_dotenv +load_dotenv() # take environment variables from .env. + import os import logging