Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
# version - ArcticMonkey:19.03.24:1743
|
2 |
|
3 |
-
|
4 |
import psutil
|
|
|
5 |
|
6 |
# components from other authors
|
7 |
from streamlit_mic_recorder import mic_recorder
|
@@ -12,6 +13,10 @@ from audio_processing.T2A import T2A
|
|
12 |
from command.utils import build_chain
|
13 |
from llm.llm_factory import LLM_Factory
|
14 |
|
|
|
|
|
|
|
|
|
15 |
llm_model = LLM_Factory()
|
16 |
|
17 |
print(platform.node())
|
@@ -28,10 +33,14 @@ if mac_address[-5:] == os.environ.get('MAC_address'):
|
|
28 |
else:
|
29 |
trigger = {"lc": "small"}
|
30 |
|
|
|
|
|
31 |
|
32 |
def main():
|
33 |
mic = mic_recorder(start_prompt="Record", stop_prompt="Stop", just_once=True)
|
34 |
|
|
|
|
|
35 |
if mic is not None:
|
36 |
a2t = A2T(mic["bytes"])
|
37 |
text = a2t.predict()
|
@@ -45,8 +54,7 @@ def main():
|
|
45 |
response = llm.execution() if llm is not None else "Oops occurred some error. Please try again. Who is Jhon Galt!"
|
46 |
|
47 |
# Треба буде переписати клас, передавати текст не через __init__ а в autoplay.
|
48 |
-
t2a
|
49 |
-
t2a.autoplay()
|
50 |
|
51 |
|
52 |
if __name__ == "__main__":
|
|
|
1 |
# version - ArcticMonkey:19.03.24:1743
|
2 |
|
3 |
+
# python core libraries
|
4 |
import psutil
|
5 |
+
import platform
|
6 |
|
7 |
# components from other authors
|
8 |
from streamlit_mic_recorder import mic_recorder
|
|
|
13 |
from command.utils import build_chain
|
14 |
from llm.llm_factory import LLM_Factory
|
15 |
|
16 |
+
|
17 |
+
# Можна редагувати аби не повтрювалось
|
18 |
+
greeting_text = "Hi, my name is M8... oops, that's from my future, but right now I'm Chelsea, your personal voice assistant. Ask me anything you want and I'll try to help you. Well, maybe you want to talk about your favourite band, maybe Bring Me The Horizon. You want to talk about Chelsea Smile."
|
19 |
+
|
20 |
llm_model = LLM_Factory()
|
21 |
|
22 |
print(platform.node())
|
|
|
33 |
else:
|
34 |
trigger = {"lc": "small"}
|
35 |
|
36 |
+
t2a = T2A()
|
37 |
+
|
38 |
|
39 |
def main():
|
40 |
mic = mic_recorder(start_prompt="Record", stop_prompt="Stop", just_once=True)
|
41 |
|
42 |
+
t2a.autoplay(greeting_text)
|
43 |
+
|
44 |
if mic is not None:
|
45 |
a2t = A2T(mic["bytes"])
|
46 |
text = a2t.predict()
|
|
|
54 |
response = llm.execution() if llm is not None else "Oops occurred some error. Please try again. Who is Jhon Galt!"
|
55 |
|
56 |
# Треба буде переписати клас, передавати текст не через __init__ а в autoplay.
|
57 |
+
t2a.autoplay(response)
|
|
|
58 |
|
59 |
|
60 |
if __name__ == "__main__":
|