Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ hf_token = os.getenv("HF_TOKEN")
|
|
| 23 |
# ---------------------------------------------------------------------
|
| 24 |
# Script Generation Function
|
| 25 |
# ---------------------------------------------------------------------
|
| 26 |
-
@spaces.GPU(duration=
|
| 27 |
def generate_script(user_prompt: str, model_id: str, token: str, duration: int):
|
| 28 |
try:
|
| 29 |
tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=token)
|
|
@@ -63,7 +63,7 @@ def generate_script(user_prompt: str, model_id: str, token: str, duration: int):
|
|
| 63 |
# ---------------------------------------------------------------------
|
| 64 |
# Voice-Over Generation Function (Inactive)
|
| 65 |
# ---------------------------------------------------------------------
|
| 66 |
-
@spaces.GPU(duration=
|
| 67 |
def generate_voice(script: str, speaker: str = "default"):
|
| 68 |
try:
|
| 69 |
# Placeholder for inactive state
|
|
@@ -74,7 +74,7 @@ def generate_voice(script: str, speaker: str = "default"):
|
|
| 74 |
# ---------------------------------------------------------------------
|
| 75 |
# Music Generation Function (facebook/musicgen-medium)
|
| 76 |
# ---------------------------------------------------------------------
|
| 77 |
-
@spaces.GPU(duration=
|
| 78 |
def generate_music(prompt: str, audio_length: int):
|
| 79 |
try:
|
| 80 |
# Load facebook/musicgen-medium model
|
|
|
|
| 23 |
# ---------------------------------------------------------------------
|
| 24 |
# Script Generation Function
|
| 25 |
# ---------------------------------------------------------------------
|
| 26 |
+
@spaces.GPU(duration=100)
|
| 27 |
def generate_script(user_prompt: str, model_id: str, token: str, duration: int):
|
| 28 |
try:
|
| 29 |
tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=token)
|
|
|
|
| 63 |
# ---------------------------------------------------------------------
|
| 64 |
# Voice-Over Generation Function (Inactive)
|
| 65 |
# ---------------------------------------------------------------------
|
| 66 |
+
@spaces.GPU(duration=100)
|
| 67 |
def generate_voice(script: str, speaker: str = "default"):
|
| 68 |
try:
|
| 69 |
# Placeholder for inactive state
|
|
|
|
| 74 |
# ---------------------------------------------------------------------
|
| 75 |
# Music Generation Function (facebook/musicgen-medium)
|
| 76 |
# ---------------------------------------------------------------------
|
| 77 |
+
@spaces.GPU(duration=100)
|
| 78 |
def generate_music(prompt: str, audio_length: int):
|
| 79 |
try:
|
| 80 |
# Load facebook/musicgen-medium model
|