Spaces:
Runtime error
Runtime error
Commit
·
9e3ca3b
1
Parent(s):
b96a4dc
adding predict() method that uses client
Browse files
app.py
CHANGED
|
@@ -38,6 +38,22 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
| 38 |
|
| 39 |
|
| 40 |
def process_speech(sound):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
"""
|
| 42 |
processing sound using seamless_m4t
|
| 43 |
"""
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
def process_speech(sound):
|
| 41 |
+
"""
|
| 42 |
+
processing sound using seamless_m4t
|
| 43 |
+
"""
|
| 44 |
+
# task_name = "T2TT"
|
| 45 |
+
result = client.predict(task_name="S2TT (Speech to Text translation)",
|
| 46 |
+
audio_source="microphone",
|
| 47 |
+
input_audio_mic=sound,
|
| 48 |
+
input_audio_file=None,
|
| 49 |
+
input_text=None,
|
| 50 |
+
source_language=None,
|
| 51 |
+
target_language="English")
|
| 52 |
+
print(result)
|
| 53 |
+
return result[1]
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def process_speech_using_model(sound):
|
| 57 |
"""
|
| 58 |
processing sound using seamless_m4t
|
| 59 |
"""
|