sandesh-bharadwaj commited on
Commit
923704c
1 Parent(s): e6dc36b

ZeroGPU fixes complete, centered MainWindow. commit 2 of 2

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -117,7 +117,7 @@ def generate_video_description(video_descriptor, google_api_key, toggle_advanced
117
  raise gr.Error("Exception raised: ", e)
118
 
119
  # Function to generate music based on the video description
120
- @spaces.GPU
121
  def generate_music(music_generator, music_prompt, num_samples):
122
  global video_duration, audio_paths, session_dir
123
  try:
@@ -180,8 +180,12 @@ def mix_music_with_video(video_file, dropdown_index, orig_clip_vol, generated_au
180
 
181
  return gr.Video(final_video_path, height=640, show_download_button=False, show_label=False, visible=True), gr.DownloadButton("Download final video", value=final_video_path, visible=True, interactive=True)
182
 
 
 
 
 
183
  # Gradio Blocks interface
184
- with gr.Blocks(delete_cache=(1800, 3600)) as demo:
185
  # Create session-specific temp dir
186
  session_dir = create_session_dir()
187
 
@@ -224,7 +228,8 @@ with gr.Blocks(delete_cache=(1800, 3600)) as demo:
224
 
225
  with gr.Column(scale=3.5) as MainWindow:
226
  # Main window with UI elements
227
- gr.Image("assets/VidTune-Logo-Without-BG.png", width=200, interactive=False, show_download_button=False, show_label=False)
 
228
  gr.Markdown(
229
  """
230
  <div style="font-size: 35px; font-weight: bold;">VidTune: Where Videos Find Their Melody</div>
 
117
  raise gr.Error("Exception raised: ", e)
118
 
119
  # Function to generate music based on the video description
120
+ @spaces.GPU(duration=240)
121
  def generate_music(music_generator, music_prompt, num_samples):
122
  global video_duration, audio_paths, session_dir
123
  try:
 
180
 
181
  return gr.Video(final_video_path, height=640, show_download_button=False, show_label=False, visible=True), gr.DownloadButton("Download final video", value=final_video_path, visible=True, interactive=True)
182
 
183
+ css = '''
184
+ h2, div, p, img{text-align:center}
185
+ '''
186
+
187
  # Gradio Blocks interface
188
+ with gr.Blocks(css=css, delete_cache=(1800, 3600)) as demo:
189
  # Create session-specific temp dir
190
  session_dir = create_session_dir()
191
 
 
228
 
229
  with gr.Column(scale=3.5) as MainWindow:
230
  # Main window with UI elements
231
+ gr.set_static_paths(paths=["assets/"])
232
+ gr.Markdown("""<center><img src='/file=assets/VidTune-Logo-Without-BG.png' style="width:200px; margin-bottom:10px"></center>""")
233
  gr.Markdown(
234
  """
235
  <div style="font-size: 35px; font-weight: bold;">VidTune: Where Videos Find Their Melody</div>