Carley1234 commited on
Commit
8adfead
·
verified ·
1 Parent(s): a818820

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -33,7 +33,7 @@ supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
33
 
34
  # --- Model Loading ---
35
  device = "cpu"
36
- model_id = "facebook/audiogen-small"
37
  audio_pipe = None
38
  load_error = None
39
  is_processing = False
@@ -126,6 +126,9 @@ async def generate_effect(job_id: str, prompt: str = Form(...), duration: int =
126
  if audio_data.size > 0:
127
  audio_data = audio_data - np.mean(audio_data)
128
 
 
 
 
129
  # Standardize shape
130
  if audio_data.ndim == 3:
131
  audio_data = audio_data[0]
 
33
 
34
  # --- Model Loading ---
35
  device = "cpu"
36
+ model_id = "facebook/audiogen-medium"
37
  audio_pipe = None
38
  load_error = None
39
  is_processing = False
 
126
  if audio_data.size > 0:
127
  audio_data = audio_data - np.mean(audio_data)
128
 
129
+ # 2. Soft-clipping to prevent digital artifacts on saturation
130
+ audio_data = np.tanh(audio_data * 1.2)
131
+
132
  # Standardize shape
133
  if audio_data.ndim == 3:
134
  audio_data = audio_data[0]