Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,24 +3,24 @@ import sys
|
|
| 3 |
try:
|
| 4 |
import audioop
|
| 5 |
except ImportError:
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
# Mocking audioop if it's completely missing to let Gradio start
|
| 12 |
-
class MockAudioop:
|
| 13 |
-
def getsample(self, *args, **kwargs):
|
| 14 |
-
return 0
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
import gradio as gr
|
| 22 |
import os
|
| 23 |
-
import sys
|
| 24 |
import json
|
| 25 |
import re
|
| 26 |
|
|
|
|
| 3 |
try:
|
| 4 |
import audioop
|
| 5 |
except ImportError:
|
| 6 |
+
# Mocking audioop for Python 3.13 compatibility
|
| 7 |
+
class MockAudioop:
|
| 8 |
+
def getsample(self, *args, **kwargs):
|
| 9 |
+
return 0
|
| 10 |
+
|
| 11 |
+
def max(self, *args, **kwargs):
|
| 12 |
+
return 0
|
| 13 |
|
| 14 |
+
def minmax(self, *args, **kwargs):
|
| 15 |
+
return (0, 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
def avg(self, *args, **kwargs):
|
| 18 |
+
return 0
|
| 19 |
|
| 20 |
+
sys.modules["audioop"] = MockAudioop()
|
| 21 |
|
| 22 |
import gradio as gr
|
| 23 |
import os
|
|
|
|
| 24 |
import json
|
| 25 |
import re
|
| 26 |
|