Spaces:
Runtime error
Runtime error
Peter Michael Gits
Claude
Fix Dockerfile directory permissions - create /app as root before switching users
26096f4 Download app_versioned.py from pgits/stt-gpu-service-python-v4: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/pgits/stt-gpu-service-python-v4/resolve/main/app_versioned.py
- Command line
-
hf download hf://spaces/pgits/stt-gpu-service-python-v4/app_versioned.py
-
curl -L -o app_versioned.py https://huggingface.co/spaces/pgits/stt-gpu-service-python-v4/resolve/main/app_versioned.py
1.41 kB
| import gradio as gr | |
| import time | |
| # Semantic versioning as requested | |
| VERSION = "1.0.0" | |
| COMMIT_SHA = "bdf6505" | |
| def health_check(): | |
| return { | |
| "status": "healthy", | |
| "timestamp": time.time(), | |
| "version": VERSION, | |
| "commit_sha": COMMIT_SHA, | |
| "message": "STT Service Test - Ready for model integration" | |
| } | |
| def placeholder_transcribe(audio): | |
| if audio is None: | |
| return "No audio provided" | |
| return f"Placeholder: Audio received (type: {type(audio)}) - STT model integration pending" | |
| # Create interface with version display | |
| with gr.Blocks(title="STT GPU Service Working Test") as demo: | |
| gr.Markdown("# 🎙️ STT GPU Service - Working Test") | |
| gr.Markdown("Successfully deployed! Ready for STT model integration.") | |
| with gr.Tab("Health Check"): | |
| health_btn = gr.Button("Check Health") | |
| health_output = gr.JSON() | |
| health_btn.click(health_check, outputs=health_output) | |
| with gr.Tab("Audio Test"): | |
| audio_input = gr.Audio(type="numpy") | |
| transcribe_btn = gr.Button("Test Transcribe") | |
| output_text = gr.Textbox() | |
| transcribe_btn.click(placeholder_transcribe, inputs=audio_input, outputs=output_text) | |
| # Version display in small text at bottom as requested | |
| gr.Markdown(f"<small>v{VERSION} (SHA: {COMMIT_SHA})</small>", elem_id="version-info") | |
| if __name__ == "__main__": | |
| demo.launch() |