warisqr007 commited on
Commit
a71f5bf
·
1 Parent(s): fd94e10
Files changed (2) hide show
  1. app.py +19 -1
  2. requirements.txt +3 -1
app.py CHANGED
@@ -7,6 +7,8 @@ import gradio as gr
7
  import matplotlib.pyplot as plt
8
 
9
  from huggingface_hub import hf_hub_download
 
 
10
 
11
  # IMPORTANT:
12
  # Your Space needs access to VocosVocoderModule.
@@ -20,6 +22,22 @@ MODEL_REPO_ID = os.getenv("MODEL_REPO_ID", "warisqr007/StreamingVocos")
20
  CKPT_FILENAME = os.getenv("CKPT_FILENAME", "epoch=3.ckpt")
21
  SAMPLE_RATE = int(os.getenv("SAMPLE_RATE", "16000"))
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  def _fig_to_rgb_array(fig):
25
  """Convert a matplotlib figure to an RGB numpy array."""
@@ -162,4 +180,4 @@ with gr.Blocks() as demo:
162
  )
163
 
164
  demo.queue()
165
- demo.launch()
 
7
  import matplotlib.pyplot as plt
8
 
9
  from huggingface_hub import hf_hub_download
10
+ from gradio_client import utils as grc_utils
11
+
12
 
13
  # IMPORTANT:
14
  # Your Space needs access to VocosVocoderModule.
 
22
  CKPT_FILENAME = os.getenv("CKPT_FILENAME", "epoch=3.ckpt")
23
  SAMPLE_RATE = int(os.getenv("SAMPLE_RATE", "16000"))
24
 
25
+ def safe_get_type(schema):
26
+ # Avoid iterating over bare booleans
27
+ if isinstance(schema, bool):
28
+ return "boolean"
29
+ if "const" in schema:
30
+ return "const"
31
+ if "enum" in schema:
32
+ return "enum"
33
+ if "type" in schema:
34
+ return schema["type"]
35
+ if schema.get("$ref"):
36
+ return "ref"
37
+ return "any"
38
+
39
+ grc_utils.get_type = safe_get_type
40
+
41
 
42
  def _fig_to_rgb_array(fig):
43
  """Convert a matplotlib figure to an RGB numpy array."""
 
180
  )
181
 
182
  demo.queue()
183
+ demo.launch(share=True)
requirements.txt CHANGED
@@ -39,7 +39,9 @@ python-dotenv
39
  debugpy
40
  einops
41
 
42
- gradio==4.44.0
 
 
43
  huggingface_hub==0.23.5
44
  scipy
45
  matplotlib
 
39
  debugpy
40
  einops
41
 
42
+ gradio>=4.44.1
43
+ gradio_client>=1.3.0
44
+ pydantic>=2.0
45
  huggingface_hub==0.23.5
46
  scipy
47
  matplotlib