>> 启动:gunicorn app_fastapi:app -c base_gunicorn.py > > pstree -ap|grep gunicorn > > kill -HUP 28144(优雅重启) > > tail -f log/gunicorn_error.log > > killa...
分类:代码片段
27 篇文章~~~ import multiprocessing import os import time """ 线上的配置信息 """ # 并行工作进程数 核心数+1个 # workers = multiprocessing.cpu_count() + 1 workers = 1 bind = '0.0....
- 创建:conda create -n base_capability python=3.9 - cd /data/python_project - git clone git@x.x.x.x:yangxy/basecapability.git - conda activate base_capa...
- centos7 - 生成:ssh-keygen -t rsa -b 4096 -C "xxx@xx.com" - cd /home/tomcat01/.ssh - cat id_rsa.pub - 公司仓库:https://x.x.x.x:xxxx/-/profile/keys - githu...
基于PySceneDetect的视频场景变换侦测与处理 [html地址](https://yangxunyu.xyz/upload/2023/11/%E5%9F%BA%E4%BA%8EPySceneDetect%E7%9A%84%E8%A7%86%E9%A2%91%E5%9C%BA%E6%99%AF...
``` def step_7_mp4_to_ts(merge_video_list): """ 将处理好的视频合并在一起 :param merge_video_list: 视频列表 :return: """ video_ts_list = [] # 视频合并前,将mp4转为ts for mp4_pa...
``` def step_4_generate_srt_by_char_calculation(wav_dict_path): result_srt_list = [] for index, item in enumerate(wav_dict_path): path = item.get("pat...
``` def step_4_generate_srt_by_whisper(wav_dict_path): """ 使用openai的whisper,从音频文件中提取文本,生成字幕文件 容易出现错别字 :param wav_dict_path: :return: """ model = whisp...
``` import json import os from typing import List, Optional from langchain import LLMChain, PromptTemplate from langchain.chat_models import ChatOpenA...
``` def replace_text(replacements, shapes): """ 替换PPT里的文本内容 """ for shape in shapes: for match, replacement in replacements.items(): match = str(match...