Upload folder using huggingface_hub
Browse files- handler.py +2 -3
- s2s_pipeline.py +14 -0
handler.py
CHANGED
@@ -2,7 +2,7 @@ from typing import Dict, Any, List, Generator
|
|
2 |
import torch
|
3 |
import os
|
4 |
import logging
|
5 |
-
from s2s_pipeline import main, rename_args,
|
6 |
import numpy as np
|
7 |
from queue import Queue
|
8 |
import threading
|
@@ -21,8 +21,7 @@ class EndpointHandler:
|
|
21 |
self.parler_tts_handler_kwargs,
|
22 |
self.melo_tts_handler_kwargs,
|
23 |
self.chat_tts_handler_kwargs,
|
24 |
-
) =
|
25 |
-
|
26 |
setup_logger(self.module_kwargs.log_level)
|
27 |
|
28 |
rename_args(self.whisper_stt_handler_kwargs, "stt")
|
|
|
2 |
import torch
|
3 |
import os
|
4 |
import logging
|
5 |
+
from s2s_pipeline import main, rename_args, get_default_arguments, setup_logger, initialize_queues_and_events, build_pipeline
|
6 |
import numpy as np
|
7 |
from queue import Queue
|
8 |
import threading
|
|
|
21 |
self.parler_tts_handler_kwargs,
|
22 |
self.melo_tts_handler_kwargs,
|
23 |
self.chat_tts_handler_kwargs,
|
24 |
+
) = get_default_arguments()
|
|
|
25 |
setup_logger(self.module_kwargs.log_level)
|
26 |
|
27 |
rename_args(self.whisper_stt_handler_kwargs, "stt")
|
s2s_pipeline.py
CHANGED
@@ -65,6 +65,20 @@ def rename_args(args, prefix):
|
|
65 |
|
66 |
args.__dict__["gen_kwargs"] = gen_kwargs
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
def parse_arguments():
|
70 |
parser = HfArgumentParser(
|
|
|
65 |
|
66 |
args.__dict__["gen_kwargs"] = gen_kwargs
|
67 |
|
68 |
+
def get_default_arguments():
|
69 |
+
return (
|
70 |
+
ModuleArguments(),
|
71 |
+
SocketReceiverArguments(),
|
72 |
+
SocketSenderArguments(),
|
73 |
+
VADHandlerArguments(),
|
74 |
+
WhisperSTTHandlerArguments(),
|
75 |
+
ParaformerSTTHandlerArguments(),
|
76 |
+
LanguageModelHandlerArguments(),
|
77 |
+
MLXLanguageModelHandlerArguments(),
|
78 |
+
ParlerTTSHandlerArguments(),
|
79 |
+
MeloTTSHandlerArguments(),
|
80 |
+
ChatTTSHandlerArguments(),
|
81 |
+
)
|
82 |
|
83 |
def parse_arguments():
|
84 |
parser = HfArgumentParser(
|