Spaces:
Runtime error
Runtime error
malvin noel
commited on
Commit
Β·
15c9bac
1
Parent(s):
9db65b8
space.gpu corrected
Browse files- app.py +1 -0
- scripts/generate_scripts.py +0 -1
- scripts/generate_subtitles.py +0 -1
- scripts/generate_voice.py +0 -1
app.py
CHANGED
@@ -30,6 +30,7 @@ def safe_copy(src: str, dst: str) -> str:
|
|
30 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
31 |
# Core processing pipeline
|
32 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
33 |
def process_video(
|
34 |
context: str,
|
35 |
instruction: str,
|
|
|
30 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
31 |
# Core processing pipeline
|
32 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
33 |
+
@spaces.GPU()
|
34 |
def process_video(
|
35 |
context: str,
|
36 |
instruction: str,
|
scripts/generate_scripts.py
CHANGED
@@ -18,7 +18,6 @@ model_id = "Qwen/Qwen2.5-0.5B"
|
|
18 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
19 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float32, trust_remote_code=True).to(device)
|
20 |
|
21 |
-
@spaces.GPU()
|
22 |
def generate_local(prompt: str, max_new_tokens: int = 350, temperature: float = 0.7) -> str:
|
23 |
device = model.device # get the device the model is on
|
24 |
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
|
|
18 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
19 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float32, trust_remote_code=True).to(device)
|
20 |
|
|
|
21 |
def generate_local(prompt: str, max_new_tokens: int = 350, temperature: float = 0.7) -> str:
|
22 |
device = model.device # get the device the model is on
|
23 |
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
scripts/generate_subtitles.py
CHANGED
@@ -84,7 +84,6 @@ def save_subtitles_to_srt(subtitles, output_path):
|
|
84 |
f.write(f"{sub['text'].strip()}\n\n")
|
85 |
|
86 |
|
87 |
-
@spaces.GPU()
|
88 |
def transcribe_audio_to_subs(audio_path):
|
89 |
"""
|
90 |
Transcrit le fichier audio en texte (via Whisper), retourne la liste
|
|
|
84 |
f.write(f"{sub['text'].strip()}\n\n")
|
85 |
|
86 |
|
|
|
87 |
def transcribe_audio_to_subs(audio_path):
|
88 |
"""
|
89 |
Transcrit le fichier audio en texte (via Whisper), retourne la liste
|
scripts/generate_voice.py
CHANGED
@@ -14,7 +14,6 @@ ENGLISH_VOICES = [
|
|
14 |
"am_fenrir"
|
15 |
]
|
16 |
|
17 |
-
@spaces.GPU()
|
18 |
def generate_voice(text: str, path: str):
|
19 |
for voice in random.sample(ENGLISH_VOICES, len(ENGLISH_VOICES)):
|
20 |
try:
|
|
|
14 |
"am_fenrir"
|
15 |
]
|
16 |
|
|
|
17 |
def generate_voice(text: str, path: str):
|
18 |
for voice in random.sample(ENGLISH_VOICES, len(ENGLISH_VOICES)):
|
19 |
try:
|