Xu Xuenan commited on
Commit
6331da0
·
1 Parent(s): fd10a14

Update app.py

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. mm_story_agent/__init__.py +4 -0
app.py CHANGED
@@ -123,7 +123,7 @@ def speech_generation_fn(story_data):
123
  story_gen_agent = MMStoryAgent()
124
  story_gen_agent.generate_speech(config, story_data)
125
 
126
- @spaces.GPU(duration=120)
127
  def sound_generation_fn(sound_guidance_scale, sound_seed, n_candidate_per_text,
128
  story_data, progress=gr.Progress(track_tqdm=True)):
129
  deep_update(config, {
 
123
  story_gen_agent = MMStoryAgent()
124
  story_gen_agent.generate_speech(config, story_data)
125
 
126
+ @spaces.GPU(duration=60)
127
  def sound_generation_fn(sound_guidance_scale, sound_seed, n_candidate_per_text,
128
  story_data, progress=gr.Progress(track_tqdm=True)):
129
  deep_update(config, {
mm_story_agent/__init__.py CHANGED
@@ -36,21 +36,25 @@ class MMStoryAgent:
36
 
37
  def generate_speech(self, config, pages):
38
  story_dir = Path(config["story_dir"])
 
39
  speech_agent = CosyVoiceAgent(config["speech_generation"])
40
  speech_agent.call(pages, story_dir / "speech")
41
 
42
  def generate_sound(self, config, pages):
43
  story_dir = Path(config["story_dir"])
 
44
  sound_agent = AudioLDM2Agent(config["sound_generation"])
45
  sound_agent.call(pages, story_dir / "sound")
46
 
47
  def generate_music(self, config, pages):
48
  story_dir = Path(config["story_dir"])
 
49
  music_agent = MusicGenAgent(config["music_generation"])
50
  music_agent.call(pages, story_dir / "music")
51
 
52
  def generate_image(self, config, pages):
53
  story_dir = Path(config["story_dir"])
 
54
  image_agent = StoryDiffusionAgent(config["image_generation"])
55
  image_agent.call(pages, story_dir / "image")
56
 
 
36
 
37
  def generate_speech(self, config, pages):
38
  story_dir = Path(config["story_dir"])
39
+ (story_dir / "speech").mkdir(exist_ok=True, parents=True)
40
  speech_agent = CosyVoiceAgent(config["speech_generation"])
41
  speech_agent.call(pages, story_dir / "speech")
42
 
43
  def generate_sound(self, config, pages):
44
  story_dir = Path(config["story_dir"])
45
+ (story_dir / "sound").mkdir(exist_ok=True, parents=True)
46
  sound_agent = AudioLDM2Agent(config["sound_generation"])
47
  sound_agent.call(pages, story_dir / "sound")
48
 
49
  def generate_music(self, config, pages):
50
  story_dir = Path(config["story_dir"])
51
+ (story_dir / "music").mkdir(exist_ok=True, parents=True)
52
  music_agent = MusicGenAgent(config["music_generation"])
53
  music_agent.call(pages, story_dir / "music")
54
 
55
  def generate_image(self, config, pages):
56
  story_dir = Path(config["story_dir"])
57
+ (story_dir / "image").mkdir(exist_ok=True, parents=True)
58
  image_agent = StoryDiffusionAgent(config["image_generation"])
59
  image_agent.call(pages, story_dir / "image")
60