mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 00:53:25 +00:00
feat: asr blackblox
This commit is contained in:
@ -1,16 +1,23 @@
|
||||
from blackbox.audio_to_text import AudioToText
|
||||
from blackbox.blackbox import Blackbox
|
||||
from blackbox.calculator import Calculator
|
||||
from blackbox.text_to_audio import TextToAudio
|
||||
from ..asr.asr import ASR
|
||||
from .audio_to_text import AudioToText
|
||||
from .blackbox import Blackbox
|
||||
from .calculator import Calculator
|
||||
from .text_to_audio import TextToAudio
|
||||
|
||||
|
||||
class BlackboxFactory:
|
||||
|
||||
def create_blackbox(self, blackbox_type: str, blackbox_config: dict) -> Blackbox:
|
||||
if blackbox_type == "audio_to_text":
|
||||
def __init__(self) -> None:
|
||||
self.asr = ASR("./.env.yaml")
|
||||
pass
|
||||
|
||||
def create_blackbox(self, blackbox_name: str, blackbox_config: dict) -> Blackbox:
|
||||
if blackbox_name == "audio_to_text":
|
||||
return AudioToText(blackbox_config)
|
||||
if blackbox_type == "text_to_audio":
|
||||
if blackbox_name == "text_to_audio":
|
||||
return TextToAudio(blackbox_config)
|
||||
if blackbox_type == "calculator":
|
||||
if blackbox_name == "calculator":
|
||||
return Calculator(blackbox_config)
|
||||
if blackbox_name == "asr":
|
||||
return self.asr
|
||||
raise ValueError("Invalid blockbox type")
|
||||
Reference in New Issue
Block a user