Bils commited on
Commit
a6afe59
·
verified ·
1 Parent(s): 0ef49a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import os
2
  import re
3
  import torch
4
  import tempfile
@@ -205,9 +205,7 @@ def generate_music(prompt: str, audio_length: int):
205
  musicgen_model, musicgen_processor = get_musicgen_model(model_key)
206
 
207
  device = "cuda" if torch.cuda.is_available() else "cpu"
208
- # Process the input and move each tensor to the proper device
209
- inputs = musicgen_processor(text=[prompt], padding=True, return_tensors="pt")
210
- inputs = {k: v.to(device) for k, v in inputs.items()}
211
 
212
  with torch.inference_mode():
213
  outputs = musicgen_model.generate(**inputs, max_new_tokens=audio_length)
@@ -316,12 +314,12 @@ with gr.Blocks(css="""
316
  # Custom Header
317
  with gr.Row(elem_classes="header"):
318
  gr.Markdown("""
319
- <h1>🎧 AI Promo Studio</h1>
320
- <p>Your all-in-one AI solution for crafting engaging audio promos.</p>
321
  """)
322
 
323
  gr.Markdown("""
324
- Welcome to **AI Promo Studio**! This platform leverages state-of-the-art AI models to help you generate:
325
 
326
  - **Script**: Generate a compelling voice-over script with LLaMA.
327
  - **Voice Synthesis**: Create natural-sounding voice-overs using Coqui TTS.
@@ -430,7 +428,7 @@ with gr.Blocks(css="""
430
  <hr>
431
  Created with ❤️ by <a href="https://bilsimaging.com" target="_blank" style="color: #88aaff;">bilsimaging.com</a>
432
  <br>
433
- <small>AI Promo Studio &copy; 2025</small>
434
  </div>
435
  """)
436
 
 
1
+ # import os
2
  import re
3
  import torch
4
  import tempfile
 
205
  musicgen_model, musicgen_processor = get_musicgen_model(model_key)
206
 
207
  device = "cuda" if torch.cuda.is_available() else "cpu"
208
+ inputs = musicgen_processor(text=[prompt], padding=True, return_tensors="pt").to(device)
 
 
209
 
210
  with torch.inference_mode():
211
  outputs = musicgen_model.generate(**inputs, max_new_tokens=audio_length)
 
314
  # Custom Header
315
  with gr.Row(elem_classes="header"):
316
  gr.Markdown("""
317
+ <h1>🎧 AI Ads Promo</h1>
318
+ <p>Your all-in-one AI solution for crafting engaging audio ads. <br><em>Demo MVP</em></p>
319
  """)
320
 
321
  gr.Markdown("""
322
+ Welcome to **AI Ads Promo (Demo MVP)**! This platform leverages state-of-the-art AI models to help you generate:
323
 
324
  - **Script**: Generate a compelling voice-over script with LLaMA.
325
  - **Voice Synthesis**: Create natural-sounding voice-overs using Coqui TTS.
 
428
  <hr>
429
  Created with ❤️ by <a href="https://bilsimaging.com" target="_blank" style="color: #88aaff;">bilsimaging.com</a>
430
  <br>
431
+ <small>AI Ads Promo (Demo MVP) &copy; 2025</small>
432
  </div>
433
  """)
434