Update main_process/salamandra_router.py
Browse files
main_process/salamandra_router.py
CHANGED
|
@@ -18,22 +18,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 18 |
from openai import OpenAI
|
| 19 |
|
| 20 |
# --- Internal Modules / Project Imports ---
|
| 21 |
-
from
|
| 22 |
-
extract_scenes,
|
| 23 |
-
add_ocr_and_faces,
|
| 24 |
-
keyframes_every_second_extraction,
|
| 25 |
-
extract_descripcion_escena
|
| 26 |
-
)
|
| 27 |
-
|
| 28 |
-
from asr_client import (
|
| 29 |
-
extract_audio_from_video,
|
| 30 |
-
diarize_audio,
|
| 31 |
-
transcribe_long_audio,
|
| 32 |
-
transcribe_short_audio,
|
| 33 |
-
identificar_veu
|
| 34 |
-
)
|
| 35 |
-
|
| 36 |
-
from schat_client import resumir_frases_salamandra, identificar_personajes, free_narration_schat
|
| 37 |
|
| 38 |
from storage.common import validate_token
|
| 39 |
from storage.files.file_manager import FileManager
|
|
@@ -779,7 +764,7 @@ class Identity_Manager:
|
|
| 779 |
result = content_escena
|
| 780 |
|
| 781 |
else:
|
| 782 |
-
result =
|
| 783 |
|
| 784 |
out = f"(AD_Descripci贸n): {result}"
|
| 785 |
|
|
@@ -919,7 +904,7 @@ class UNE_Actor:
|
|
| 919 |
|
| 920 |
else:
|
| 921 |
content = content.replace("(AD_Descripci贸n):", "").strip()
|
| 922 |
-
result =
|
| 923 |
out = f"(AD): {result} "
|
| 924 |
|
| 925 |
srt_text_modified += f"{idx}\n{start_str} --> {end_str}\n{out}\n\n"
|
|
|
|
| 18 |
from openai import OpenAI
|
| 19 |
|
| 20 |
# --- Internal Modules / Project Imports ---
|
| 21 |
+
from schat_client import summarize_sentences_salamandra, identify_characters, free_narration_schat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
from storage.common import validate_token
|
| 24 |
from storage.files.file_manager import FileManager
|
|
|
|
| 764 |
result = content_escena
|
| 765 |
|
| 766 |
else:
|
| 767 |
+
result = identify_characters(content_escena, personas)
|
| 768 |
|
| 769 |
out = f"(AD_Descripci贸n): {result}"
|
| 770 |
|
|
|
|
| 904 |
|
| 905 |
else:
|
| 906 |
content = content.replace("(AD_Descripci贸n):", "").strip()
|
| 907 |
+
result = summarize_sentences_salamandra(content, silence_dict[idx])
|
| 908 |
out = f"(AD): {result} "
|
| 909 |
|
| 910 |
srt_text_modified += f"{idx}\n{start_str} --> {end_str}\n{out}\n\n"
|