diff --git a/src/diart/console/client.py b/src/diart/console/client.py index 86c9e29..275999f 100644 --- a/src/diart/console/client.py +++ b/src/diart/console/client.py @@ -4,11 +4,10 @@ from typing import Optional, Text import rx.operators as ops -from websocket import WebSocket - from diart import argdoc from diart import sources as src from diart import utils +from websocket import WebSocket def send_audio(ws: WebSocket, source: Text, step: float, sample_rate: int): diff --git a/src/diart/console/serve.py b/src/diart/console/serve.py index 8a8386b..279a08b 100644 --- a/src/diart/console/serve.py +++ b/src/diart/console/serve.py @@ -2,7 +2,6 @@ from pathlib import Path import torch - from diart import argdoc from diart import models as m from diart import utils diff --git a/src/diart/websockets.py b/src/diart/websockets.py index 5bbc5dc..f772a02 100644 --- a/src/diart/websockets.py +++ b/src/diart/websockets.py @@ -7,9 +7,9 @@ import numpy as np from websocket_server import WebsocketServer -from . import utils from . import blocks from . import sources as src +from . import utils from .inference import StreamingInference # Configure logging @@ -31,9 +31,7 @@ class ProxyAudioSource(src.AudioSource): """ def __init__( - self, - uri: str, - sample_rate: int, + self, uri: str, sample_rate: int, ): # FIXME sample_rate is not being used, this can be confusing and lead to incompatibilities. # I would prefer the client to send a JSON with data and sample rate, then resample if needed @@ -314,7 +312,9 @@ def run(self) -> None: logger.warning(f"WebSocket server connection error: {e}") retry_count += 1 if retry_count < max_retries: - logger.info(f"Attempting to restart server (attempt {retry_count + 1}/{max_retries})") + logger.info( + f"Attempting to restart server (attempt {retry_count + 1}/{max_retries})" + ) else: logger.error("Max retry attempts reached. Server shutting down.") except Exception as e: