Skip to content

Commit

Permalink
apply styling with black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
janaab11 committed Jan 3, 2025
1 parent 12f7ba9 commit 0f6ac4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/diart/console/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion src/diart/console/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from pathlib import Path

import torch

from diart import argdoc
from diart import models as m
from diart import utils
Expand Down
10 changes: 5 additions & 5 deletions src/diart/websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0f6ac4e

Please sign in to comment.