learnmlf commited on
Commit
e10d911
·
1 Parent(s): 3a71288

Fix Gradio component compatibility

Browse files

- Remove 'info' parameter from Video, Audio, Textbox, and Checkbox components
- Move info text to component labels for better compatibility
- Ensure compatibility with different Gradio versions in HF Space

Files changed (1) hide show
  1. app.py +8 -12
app.py CHANGED
@@ -447,25 +447,22 @@ with gr.Blocks(title="hf_AC Audio Foley Generator", theme=gr.themes.Soft()) as d
447
  # 必需输入
448
  gr.Markdown("### 📹 必需输入")
449
  video_input = gr.Video(
450
- label="视频文件",
451
- format="mp4",
452
- info="上传需要生成音频的视频文件"
453
  )
454
 
455
  # 可选输入
456
  gr.Markdown("### 🎛️ 可选输入")
457
  audio_input = gr.Audio(
458
- label="参考音频",
459
  type="filepath",
460
- sources=["upload"],
461
- info="提供音色、风格、节奏参考(支持细粒度控制)"
462
  )
463
 
464
  prompt_input = gr.Textbox(
465
- label="文本提示",
466
  placeholder="例如: '脚步声', '金属碰撞声', '鸟叫声'",
467
- lines=2,
468
- info="描述想要的音频类型(留空则根据视频自动生成)"
469
  )
470
 
471
  # 高级选项
@@ -488,9 +485,8 @@ with gr.Blocks(title="hf_AC Audio Foley Generator", theme=gr.themes.Soft()) as d
488
  )
489
 
490
  mask_away_clip = gr.Checkbox(
491
- label="忽略视觉特征 (mask_away_clip)",
492
- value=False,
493
- info="当视频和参考音频差异较大且生成效果不佳时启用"
494
  )
495
 
496
  with gr.Column(scale=1):
 
447
  # 必需输入
448
  gr.Markdown("### 📹 必需输入")
449
  video_input = gr.Video(
450
+ label="视频文件 - 上传需要生成音频的视频文件",
451
+ format="mp4"
 
452
  )
453
 
454
  # 可选输入
455
  gr.Markdown("### 🎛️ 可选输入")
456
  audio_input = gr.Audio(
457
+ label="参考音频 - 提供音色、风格、节奏参考(支持细粒度控制)",
458
  type="filepath",
459
+ sources=["upload"]
 
460
  )
461
 
462
  prompt_input = gr.Textbox(
463
+ label="文本提示 - 描述想要的音频类型(留空则根据视频自动生成)",
464
  placeholder="例如: '脚步声', '金属碰撞声', '鸟叫声'",
465
+ lines=2
 
466
  )
467
 
468
  # 高级选项
 
485
  )
486
 
487
  mask_away_clip = gr.Checkbox(
488
+ label="忽略视觉特征 (mask_away_clip) - 当视频和参考音频差异较大且生成效果不佳时启用",
489
+ value=False
 
490
  )
491
 
492
  with gr.Column(scale=1):