Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,20 +71,12 @@ No markdown, no bullet points. Just the reply text."""
|
|
| 71 |
return f"❌ Error: {str(e)}\n\nMake sure HF_TOKEN is set in your Space secrets."
|
| 72 |
|
| 73 |
def transcribe_audio(audio_path):
|
| 74 |
-
print("Audio
|
| 75 |
|
| 76 |
if audio_path is None:
|
| 77 |
-
return ""
|
| 78 |
|
| 79 |
-
|
| 80 |
-
result = speech_client.automatic_speech_recognition(audio_path)
|
| 81 |
-
print("Result:", result)
|
| 82 |
-
|
| 83 |
-
return result.text if hasattr(result, "text") else str(result)
|
| 84 |
-
|
| 85 |
-
except Exception as e:
|
| 86 |
-
print("VOICE ERROR:", repr(e))
|
| 87 |
-
return f"Voice transcription failed: {repr(e)}"
|
| 88 |
|
| 89 |
# ── CSS ──────────────────────────────────────────────────────────────────────
|
| 90 |
css = """
|
|
|
|
| 71 |
return f"❌ Error: {str(e)}\n\nMake sure HF_TOKEN is set in your Space secrets."
|
| 72 |
|
| 73 |
def transcribe_audio(audio_path):
|
| 74 |
+
print("Audio received:", audio_path)
|
| 75 |
|
| 76 |
if audio_path is None:
|
| 77 |
+
return "No audio received"
|
| 78 |
|
| 79 |
+
return f"Audio file received: {audio_path}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
# ── CSS ──────────────────────────────────────────────────────────────────────
|
| 82 |
css = """
|