Skip to content

Commit

Permalink
Suppressing PortAudio debug messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrisita committed Apr 7, 2024
1 parent 5d8757b commit 4d2f0f6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 21 deletions.
24 changes: 22 additions & 2 deletions software/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions software/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pytimeparse = "^1.1.8"
python-crontab = "^3.0.0"
inquirer = "^3.2.4"
pyqrcode = "^1.2.1"
sounddevice = "^0.4.6"

[build-system]
requires = ["poetry-core"]
Expand Down
39 changes: 20 additions & 19 deletions software/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from source.server.tunnel import create_tunnel
from source.server.server import main
from source.server.utils.local_mode import select_local_model
import sounddevice

import signal
app = typer.Typer()
Expand All @@ -17,32 +18,32 @@ def run(
server: bool = typer.Option(False, "--server", help="Run server"),
server_host: str = typer.Option("0.0.0.0", "--server-host", help="Specify the server host where the server will deploy"),
server_port: int = typer.Option(10001, "--server-port", help="Specify the server port where the server will deploy"),

tunnel_service: str = typer.Option("ngrok", "--tunnel-service", help="Specify the tunnel service"),
expose: bool = typer.Option(False, "--expose", help="Expose server to internet"),

client: bool = typer.Option(False, "--client", help="Run client"),
server_url: str = typer.Option(None, "--server-url", help="Specify the server URL that the client should expect. Defaults to server-host and server-port"),
client_type: str = typer.Option("auto", "--client-type", help="Specify the client type"),

llm_service: str = typer.Option("litellm", "--llm-service", help="Specify the LLM service"),

model: str = typer.Option("gpt-4", "--model", help="Specify the model"),
llm_supports_vision: bool = typer.Option(False, "--llm-supports-vision", help="Specify if the LLM service supports vision"),
llm_supports_functions: bool = typer.Option(False, "--llm-supports-functions", help="Specify if the LLM service supports functions"),
context_window: int = typer.Option(2048, "--context-window", help="Specify the context window size"),
max_tokens: int = typer.Option(4096, "--max-tokens", help="Specify the maximum number of tokens"),
temperature: float = typer.Option(0.8, "--temperature", help="Specify the temperature for generation"),

tts_service: str = typer.Option("openai", "--tts-service", help="Specify the TTS service"),

stt_service: str = typer.Option("openai", "--stt-service", help="Specify the STT service"),

local: bool = typer.Option(False, "--local", help="Use recommended local services for LLM, STT, and TTS"),

qr: bool = typer.Option(False, "--qr", help="Print the QR code for the server URL")
):

_run(
server=server,
server_host=server_host,
Expand All @@ -69,41 +70,41 @@ def _run(
server: bool = False,
server_host: str = "0.0.0.0",
server_port: int = 10001,

tunnel_service: str = "bore",
expose: bool = False,

client: bool = False,
server_url: str = None,
client_type: str = "auto",

llm_service: str = "litellm",

model: str = "gpt-4",
llm_supports_vision: bool = False,
llm_supports_functions: bool = False,
context_window: int = 2048,
max_tokens: int = 4096,
temperature: float = 0.8,

tts_service: str = "openai",

stt_service: str = "openai",

local: bool = False,

qr: bool = False
):

if local:
tts_service = "piper"
# llm_service = "llamafile"
stt_service = "local-whisper"
select_local_model()

if not server_url:
server_url = f"{server_host}:{server_port}"

if not server and not client:
server = True
client = True
Expand Down Expand Up @@ -152,4 +153,4 @@ def handle_exit(signum, frame):
if client:
client_thread.join()
except KeyboardInterrupt:
os.kill(os.getpid(), signal.SIGINT)
os.kill(os.getpid(), signal.SIGINT)

0 comments on commit 4d2f0f6

Please sign in to comment.