Chelsea / app.py
CineAI's picture
v0.0.1_DigItBMTH
d5436e0
raw
history blame
1.05 kB
# version - ArcticMonkey:19.03.24:1743
import psutil
# components from other authors
from streamlit_mic_recorder import mic_recorder
# core modules
from audio_processing.A2T import A2T
from audio_processing.T2A import T2A
from command.utils import build_chain
from llm.llm_factory import LLM_Factory
llm_model = LLM_Factory()
trigger = {"lc": "small"}
def prepare_cor(input_text: str):
return build_chain.build_command_chain().handle_command(input_text)
def main():
mic = mic_recorder(start_prompt="Record", stop_prompt="Stop", just_once=True)
if mic is not None:
a2t = A2T(mic["bytes"])
text = a2t.predict()
# prepare_cor(input_text=text)
llm = llm_model.create_llm(prompt_entity=text, prompt_id=1, trigger=trigger)
response = llm.execution() if llm is not None else "Oops occurred some error. Please try again"
t2a = T2A(response)
t2a.autoplay()
if __name__ == "__main__":
print('RAM memory % used:', psutil.virtual_memory()[2]) # ~ 94 GB full memory
main()