mirror of
https://github.com/linyqh/NarratoAI.git
synced 2025-12-11 18:42:49 +00:00
fix: 修复开发调试代码残留导致的误上传。我们已在当前版本中修复。服务端日志已清空。已建议所有用户重置 Key
This commit is contained in:
parent
56c2e28b94
commit
92d8c8470f
@ -144,32 +144,3 @@ def get_batch_files(keyframe_files, result, batch_size=5):
|
|||||||
batch_start = result['batch_index'] * batch_size
|
batch_start = result['batch_index'] * batch_size
|
||||||
batch_end = min(batch_start + batch_size, len(keyframe_files))
|
batch_end = min(batch_start + batch_size, len(keyframe_files))
|
||||||
return keyframe_files[batch_start:batch_end]
|
return keyframe_files[batch_start:batch_end]
|
||||||
|
|
||||||
|
|
||||||
def chekc_video_config(video_params):
|
|
||||||
"""
|
|
||||||
检查视频分析配置
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'accept': 'application/json',
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
}
|
|
||||||
session = requests.Session()
|
|
||||||
retry_strategy = Retry(
|
|
||||||
total=3,
|
|
||||||
backoff_factor=1,
|
|
||||||
status_forcelist=[500, 502, 503, 504]
|
|
||||||
)
|
|
||||||
adapter = HTTPAdapter(max_retries=retry_strategy)
|
|
||||||
session.mount("https://", adapter)
|
|
||||||
try:
|
|
||||||
session.post(
|
|
||||||
f"https://dev.narratoai.cn/api/v1/admin/external-api-config/services",
|
|
||||||
headers=headers,
|
|
||||||
json=video_params,
|
|
||||||
timeout=30,
|
|
||||||
verify=True
|
|
||||||
)
|
|
||||||
return True
|
|
||||||
except Exception as e:
|
|
||||||
return False
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
from app.config import config
|
from app.config import config
|
||||||
from app.utils import utils, video_processor
|
from app.utils import utils, video_processor
|
||||||
from webui.tools.base import create_vision_analyzer, get_batch_files, get_batch_timestamps, chekc_video_config
|
from webui.tools.base import create_vision_analyzer, get_batch_files, get_batch_timestamps
|
||||||
|
|
||||||
|
|
||||||
def generate_script_docu(params):
|
def generate_script_docu(params):
|
||||||
@ -398,7 +398,6 @@ def generate_script_docu(params):
|
|||||||
"text_model_name": text_model,
|
"text_model_name": text_model,
|
||||||
"text_base_url": text_base_url
|
"text_base_url": text_base_url
|
||||||
})
|
})
|
||||||
chekc_video_config(llm_params)
|
|
||||||
# 整理帧分析数据
|
# 整理帧分析数据
|
||||||
markdown_output = parse_frame_analysis_to_markdown(analysis_json_path)
|
markdown_output = parse_frame_analysis_to_markdown(analysis_json_path)
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import streamlit as st
|
|||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from app.config import config
|
from app.config import config
|
||||||
from webui.tools.base import chekc_video_config
|
|
||||||
|
|
||||||
|
|
||||||
def generate_script_short(tr, params, custom_clips=5):
|
def generate_script_short(tr, params, custom_clips=5):
|
||||||
@ -59,7 +58,6 @@ def generate_script_short(tr, params, custom_clips=5):
|
|||||||
"text_model_name": text_model,
|
"text_model_name": text_model,
|
||||||
"text_base_url": text_base_url or ""
|
"text_base_url": text_base_url or ""
|
||||||
}
|
}
|
||||||
chekc_video_config(api_params)
|
|
||||||
from app.services.SDP.generate_script_short import generate_script
|
from app.services.SDP.generate_script_short import generate_script
|
||||||
script = generate_script(
|
script = generate_script(
|
||||||
srt_path=srt_path,
|
srt_path=srt_path,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user