Spaces:
Sleeping
Sleeping
fix
Browse files
app.py
CHANGED
@@ -19,15 +19,15 @@ if hf_token:
|
|
19 |
else:
|
20 |
print("⚠️ Hugging Face API token is missing! Set HF_TOKEN in Space secrets.")
|
21 |
|
22 |
-
# ✅ Sound generation tool with
|
23 |
@tool
|
24 |
def generate_sound(sound_type: str, duration: int) -> str:
|
25 |
"""
|
26 |
-
Generates a simple sound
|
27 |
-
|
28 |
Args:
|
29 |
sound_type (str): The type of sound to generate (e.g., 'rain', 'white_noise').
|
30 |
-
duration (int): The duration of the
|
31 |
|
32 |
Returns:
|
33 |
str: The file path of the generated sound file.
|
|
|
19 |
else:
|
20 |
print("⚠️ Hugging Face API token is missing! Set HF_TOKEN in Space secrets.")
|
21 |
|
22 |
+
# ✅ Sound generation tool with type hints and docstring descriptions
|
23 |
@tool
|
24 |
def generate_sound(sound_type: str, duration: int) -> str:
|
25 |
"""
|
26 |
+
Generates a simple sound based on the specified type and duration.
|
27 |
+
|
28 |
Args:
|
29 |
sound_type (str): The type of sound to generate (e.g., 'rain', 'white_noise').
|
30 |
+
duration (int): The duration of the sound in seconds.
|
31 |
|
32 |
Returns:
|
33 |
str: The file path of the generated sound file.
|