selectmixer
commited on
Commit
·
def1f31
1
Parent(s):
f77503f
add handler
Browse files- handler.py +7 -1
handler.py
CHANGED
@@ -29,4 +29,10 @@ class EndpointHandler:
|
|
29 |
outputs = self.model.generate(inputs)
|
30 |
prediction = outputs[0].cpu().numpy()
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
outputs = self.model.generate(inputs)
|
30 |
prediction = outputs[0].cpu().numpy()
|
31 |
|
32 |
+
# Define the output file path
|
33 |
+
output_file_path = "generated_audio.wav"
|
34 |
+
|
35 |
+
# Save the generated audio to a file
|
36 |
+
audio_write(output_file_path, prediction, sample_rate=16000) # Adjust sample_rate as needed
|
37 |
+
|
38 |
+
return {"generated_audio_file": output_file_path}
|