set lang to en if not multilingual
This commit is contained in:
@@ -251,7 +251,7 @@ if __name__=="__main__":
|
|||||||
opt = parser.parse_args()
|
opt = parser.parse_args()
|
||||||
print(opt)
|
print(opt)
|
||||||
multilingual=opt.multilingual,
|
multilingual=opt.multilingual,
|
||||||
language = opt.language,
|
language = opt.language if opt.multilingual else "en",
|
||||||
task = opt.task
|
task = opt.task
|
||||||
c = Client(host=opt.host, port=opt.port)
|
c = Client(host=opt.host, port=opt.port)
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ def recv_audio(websocket):
|
|||||||
global clients
|
global clients
|
||||||
options = websocket.recv()
|
options = websocket.recv()
|
||||||
options = json.loads(options)
|
options = json.loads(options)
|
||||||
|
print(options)
|
||||||
client = ServeClient(
|
client = ServeClient(
|
||||||
websocket,
|
websocket,
|
||||||
multilingual=options["multilingual"],
|
multilingual=options["multilingual"],
|
||||||
@@ -55,7 +56,7 @@ class ServeClient:
|
|||||||
def __init__(self, websocket, task="transcribe", device=None, multilingual=False, language=None):
|
def __init__(self, websocket, task="transcribe", device=None, multilingual=False, language=None):
|
||||||
self.data = b""
|
self.data = b""
|
||||||
self.frames = b""
|
self.frames = b""
|
||||||
self.language = language
|
self.language = language if multilingual else "en"
|
||||||
self.task = task
|
self.task = task
|
||||||
self.transcriber = WhisperModel(
|
self.transcriber = WhisperModel(
|
||||||
"small" if multilingual else "small.en",
|
"small" if multilingual else "small.en",
|
||||||
|
|||||||
Reference in New Issue
Block a user