chore: Update user ID and group ID in devcontainer Dockerfile, update .gitignore to ignore __pycache__
Browse files- .devcontainer/Dockerfile +2 -2
- .gitignore +2 -1
- core/__init__.py +27 -4
- skills/weather.py +2 -1
.devcontainer/Dockerfile
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
# Run: sudo docker run -v $(pwd):/workspace/project --gpus all -it --rm <project_name>
|
3 |
|
4 |
ARG USERNAME=kitt
|
5 |
-
ARG USER_UID=
|
6 |
-
ARG USER_GID=
|
7 |
|
8 |
|
9 |
FROM nvidia/cuda:12.1.1-base-ubuntu22.04
|
|
|
2 |
# Run: sudo docker run -v $(pwd):/workspace/project --gpus all -it --rm <project_name>
|
3 |
|
4 |
ARG USERNAME=kitt
|
5 |
+
ARG USER_UID=320869193
|
6 |
+
ARG USER_GID=1429829944
|
7 |
|
8 |
|
9 |
FROM nvidia/cuda:12.1.1-base-ubuntu22.04
|
.gitignore
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
audio
|
2 |
.DS_Store
|
3 |
-
.env
|
|
|
|
1 |
audio
|
2 |
.DS_Store
|
3 |
+
.env
|
4 |
+
__pycache__
|
core/__init__.py
CHANGED
@@ -11,7 +11,7 @@ from TTS.api import TTS
|
|
11 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
12 |
|
13 |
|
14 |
-
Voice = namedtuple("voice", ["name", "neutral", "angry"])
|
15 |
|
16 |
file_full_path = pathlib.Path(os.path.realpath(__file__)).parent
|
17 |
|
@@ -20,16 +20,31 @@ voices = [
|
|
20 |
"Attenborough",
|
21 |
neutral=f"{file_full_path}/audio/attenborough/neutral.wav",
|
22 |
angry=None,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
),
|
24 |
-
Voice("Rick", neutral=f"{file_full_path}/audio/rick/neutral.wav", angry=None),
|
25 |
Voice(
|
26 |
"Freeman",
|
27 |
neutral=f"{file_full_path}/audio/freeman/neutral.wav",
|
28 |
angry="audio/freeman/angry.wav",
|
|
|
29 |
),
|
30 |
-
Voice("Walken", neutral=f"{file_full_path}/audio/walken/neutral.wav", angry=None),
|
31 |
Voice(
|
32 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
),
|
34 |
]
|
35 |
|
@@ -71,6 +86,14 @@ def voice_from_text(voice):
|
|
71 |
raise ValueError(f"Voice {voice} not found.")
|
72 |
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
def tts(
|
75 |
self,
|
76 |
text: str = "",
|
|
|
11 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
12 |
|
13 |
|
14 |
+
Voice = namedtuple("voice", ["name", "neutral", "angry", "speed"])
|
15 |
|
16 |
file_full_path = pathlib.Path(os.path.realpath(__file__)).parent
|
17 |
|
|
|
20 |
"Attenborough",
|
21 |
neutral=f"{file_full_path}/audio/attenborough/neutral.wav",
|
22 |
angry=None,
|
23 |
+
speed=1.1,
|
24 |
+
),
|
25 |
+
Voice(
|
26 |
+
"Rick",
|
27 |
+
neutral=f"{file_full_path}/audio/rick/neutral.wav",
|
28 |
+
angry=None,
|
29 |
+
speed=1.1,
|
30 |
),
|
|
|
31 |
Voice(
|
32 |
"Freeman",
|
33 |
neutral=f"{file_full_path}/audio/freeman/neutral.wav",
|
34 |
angry="audio/freeman/angry.wav",
|
35 |
+
speed=1.1,
|
36 |
),
|
|
|
37 |
Voice(
|
38 |
+
"Walken",
|
39 |
+
neutral=f"{file_full_path}/audio/walken/neutral.wav",
|
40 |
+
angry=None,
|
41 |
+
speed=1.1,
|
42 |
+
),
|
43 |
+
Voice(
|
44 |
+
"Darth Wader",
|
45 |
+
neutral=f"{file_full_path}/audio/darth/neutral.wav",
|
46 |
+
angry=None,
|
47 |
+
speed=1.1,
|
48 |
),
|
49 |
]
|
50 |
|
|
|
86 |
raise ValueError(f"Voice {voice} not found.")
|
87 |
|
88 |
|
89 |
+
def speed_from_text(voice):
|
90 |
+
for v in voices:
|
91 |
+
if voice == f"{v.name} - Neutral":
|
92 |
+
return v.speed
|
93 |
+
if voice == f"{v.name} - Angry":
|
94 |
+
return v.speed
|
95 |
+
|
96 |
+
|
97 |
def tts(
|
98 |
self,
|
99 |
text: str = "",
|
skills/weather.py
CHANGED
@@ -22,7 +22,8 @@ def get_weather(location:str= ""):
|
|
22 |
response = requests.get(url)
|
23 |
|
24 |
if response.status_code != 200:
|
25 |
-
|
|
|
26 |
|
27 |
# Parse the JSON response
|
28 |
weather_data = response.json()
|
|
|
22 |
response = requests.get(url)
|
23 |
|
24 |
if response.status_code != 200:
|
25 |
+
print(f"Failed to get weather data: {response.status_code}, {response.text}")
|
26 |
+
return f"Failed to get weather data, try again", response
|
27 |
|
28 |
# Parse the JSON response
|
29 |
weather_data = response.json()
|