playmak3r commited on
Commit
98e4936
·
1 Parent(s): 4e3063d

refactor: update model path handling and dependencies

Browse files
Files changed (2) hide show
  1. app.py +6 -6
  2. requirements.txt +1 -1
app.py CHANGED
@@ -2,14 +2,13 @@
2
  VibeVoice Gradio Demo - High-Quality Dialogue Generation Interface with Streaming Support
3
  """
4
 
5
- import argparse, os
6
- import tempfile
7
  import torch
8
  import gradio as gr
9
 
10
  from transformers.utils import logging
11
  from transformers import set_seed
12
- from huggingface_hub import snapshot_download
13
  from model import VibeVoiceDemo
14
 
15
  logging.set_verbosity_info()
@@ -17,8 +16,9 @@ logger = logging.get_logger(__name__)
17
 
18
 
19
 
20
-
21
- snapshot_download(repo_id="microsoft/VibeVoice-1.5B", local_dir="./ckpts/vibevoice")
 
22
 
23
  def create_demo_interface(demo_instance: VibeVoiceDemo):
24
  """Create the Gradio interface with streaming support."""
@@ -395,7 +395,7 @@ def parse_args():
395
  parser.add_argument(
396
  "--model_path",
397
  type=str,
398
- default="./ckpts/vibevoice",
399
  help="Path to the VibeVoice model directory",
400
  )
401
  parser.add_argument(
 
2
  VibeVoice Gradio Demo - High-Quality Dialogue Generation Interface with Streaming Support
3
  """
4
 
5
+ import argparse, os, tempfile
 
6
  import torch
7
  import gradio as gr
8
 
9
  from transformers.utils import logging
10
  from transformers import set_seed
11
+ from cached_path import cached_path
12
  from model import VibeVoiceDemo
13
 
14
  logging.set_verbosity_info()
 
16
 
17
 
18
 
19
+ model_local_dir= str(cached_path("hf://microsoft/VibeVoice-1.5B"))
20
+ #model_local_dir= "./ckpts/vibevoice"
21
+ #snapshot_download(repo_id="microsoft/VibeVoice-1.5B", local_dir=model_local_dir)
22
 
23
  def create_demo_interface(demo_instance: VibeVoiceDemo):
24
  """Create the Gradio interface with streaming support."""
 
395
  parser.add_argument(
396
  "--model_path",
397
  type=str,
398
+ default=model_local_dir,
399
  help="Path to the VibeVoice model directory",
400
  )
401
  parser.add_argument(
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
  git+https://github.com/vibevoice-community/VibeVoice
2
  soundfile
3
- huggingface_hub
 
1
  git+https://github.com/vibevoice-community/VibeVoice
2
  soundfile
3
+ cached_path