thomasjvu commited on
Commit
cf482bc
·
verified ·
1 Parent(s): 4df694e

Deploy Lisper ZeroGPU Space

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -20,6 +20,7 @@ import gradio as gr
20
  import librosa
21
  import numpy as np
22
  import soundfile as sf
 
23
  import torch
24
  from transformers import AutoProcessor, Gemma4ForConditionalGeneration
25
 
@@ -1142,6 +1143,11 @@ def analyze(audio: str | tuple[int, np.ndarray] | None, target_text: str) -> tup
1142
  return analyze_with_errors(audio, target_text)
1143
 
1144
 
 
 
 
 
 
1145
  def analysis_started(browser_recording_payload: str, uploaded_audio: str | tuple[int, np.ndarray] | None) -> tuple[str, str]:
1146
  if not browser_recording_payload.strip() and uploaded_audio is None:
1147
  return (
 
20
  import librosa
21
  import numpy as np
22
  import soundfile as sf
23
+ import spaces
24
  import torch
25
  from transformers import AutoProcessor, Gemma4ForConditionalGeneration
26
 
 
1143
  return analyze_with_errors(audio, target_text)
1144
 
1145
 
1146
+ @spaces.GPU(duration=5, size=zero_gpu_size())
1147
+ def zero_gpu_healthcheck() -> str:
1148
+ return "ok"
1149
+
1150
+
1151
  def analysis_started(browser_recording_payload: str, uploaded_audio: str | tuple[int, np.ndarray] | None) -> tuple[str, str]:
1152
  if not browser_recording_payload.strip() and uploaded_audio is None:
1153
  return (