stt-gpu-service-python-v4 / app_correct.py
Peter Michael Gits
Fix Dockerfile directory permissions - create /app as root before switching users
26096f4
import gradio as gr
import time
# Semantic versioning - updated for correct Space
VERSION = "1.0.1"
COMMIT_SHA = "TBD" # Will be updated after push
def health_check():
return {
"status": "healthy",
"timestamp": time.time(),
"version": VERSION,
"commit_sha": COMMIT_SHA,
"message": "STT Service - Ready for model integration",
"space_name": "stt-gpu-service-python-v4"
}
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 Python v4") as demo:
gr.Markdown("# 🎙️ STT GPU Service Python v4")
gr.Markdown("Working deployment! 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()