Global interpreter

pull/290/head
killian 6 months ago
parent c5bb1a910e
commit 296d84ebd2

3267
software/poetry.lock generated

File diff suppressed because it is too large Load Diff

@ -40,15 +40,16 @@ ctranslate2 = "4.1.0"
py3-tts = "^3.5" py3-tts = "^3.5"
elevenlabs = "1.2.2" elevenlabs = "1.2.2"
groq = "^0.5.0" groq = "^0.5.0"
open-interpreter = {extras = ["os"], version = "^0.2.6"} open-interpreter = {extras = ["os"], version = "*"}
litellm = "1.35.35" litellm = "*"
openai = "1.30.5" openai = "*"
pywebview = "*" pywebview = "*"
pyobjc = "*" pyobjc = "*"
sentry-sdk = "^2.4.0" sentry-sdk = "^2.4.0"
plyer = "^2.1.0" plyer = "^2.1.0"
pywinctl = "^0.3" pywinctl = "^0.3"
certifi = "^2024.7.4"
[build-system] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"

@ -10,10 +10,11 @@ from typing import List, Dict, Any
import os import os
import importlib.util import importlib.util
os.environ["STT_RUNNER"] = "server" os.environ["STT_RUNNER"] = "server"
os.environ["TTS_RUNNER"] = "server" os.environ["TTS_RUNNER"] = "server"
app = FastAPI() app = FastAPI()
app.add_middleware( app.add_middleware(
@ -40,6 +41,9 @@ async def websocket_endpoint(
): ):
await websocket.accept() await websocket.accept()
global global_interpreter
interpreter = global_interpreter
# Send the tts_service value to the client # Send the tts_service value to the client
await websocket.send_text( await websocket.send_text(
json.dumps({"type": "config", "tts_service": interpreter.interpreter.tts}) json.dumps({"type": "config", "tts_service": interpreter.interpreter.tts})
@ -104,6 +108,9 @@ async def main(server_host, server_port, profile, debug):
# Make it async # Make it async
interpreter = AsyncInterpreter(interpreter, debug) interpreter = AsyncInterpreter(interpreter, debug)
global global_interpreter
global_interpreter = interpreter
print(f"Starting server on {server_host}:{server_port}") print(f"Starting server on {server_host}:{server_port}")
config = Config(app, host=server_host, port=server_port, lifespan="on") config = Config(app, host=server_host, port=server_port, lifespan="on")
server = Server(config) server = Server(config)

Loading…
Cancel
Save