Skip to content

Commit

Permalink
0.3.3 解决脚本验证问题
Browse files Browse the repository at this point in the history
  • Loading branch information
linyqh committed Nov 10, 2024
1 parent b37b0ab commit 4bafd69
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions webui/components/script_settings.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import os
import ssl
import glob
import json
import time
import asyncio
import traceback

from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
import requests
import streamlit as st
from loguru import logger
Expand Down Expand Up @@ -432,12 +434,22 @@ def format_timestamp(time_str):
'llm_api_key': text_api_key,
'custom_prompt': st.session_state.get('custom_prompt', '')
}
response = requests.post(
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)

response = session.post(
f"{config.app.get('narrato_api_url')}/video/config",
params=api_params,
timeout=30,
verify=False
verify=True # 启用证书验证
)

custom_prompt = st.session_state.get('custom_prompt', '')
processor = ScriptProcessor(
model_name=text_model,
Expand Down

0 comments on commit 4bafd69

Please sign in to comment.