分类:代码片段

27 篇文章

gunicorn命令

>> 启动:gunicorn app_fastapi:app -c base_gunicorn.py > > pstree -ap|grep gunicorn > > kill -HUP 28144(优雅重启) > > tail -f log/gunicorn_error.log > > killa...

FastAPI gunicorn配置文件

~~~ import multiprocessing import os import time """ 线上的配置信息 """ # 并行工作进程数 核心数+1个 # workers = multiprocessing.cpu_count() + 1 workers = 1 bind = '0.0....

conda环境

- 创建: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...

配置git ssh

- 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的视频场景变换侦测与处理

基于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...

ffmpeg视频合并

``` def step_7_mp4_to_ts(merge_video_list): """ 将处理好的视频合并在一起 :param merge_video_list: 视频列表 :return: """ video_ts_list = [] # 视频合并前,将mp4转为ts for mp4_pa...

视频音频字幕文件的合并,ffmpeg

``` 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...

langchain加本地知识库,输出内容

``` import json import os from typing import List, Optional from langchain import LLMChain, PromptTemplate from langchain.chat_models import ChatOpenA...

替换PPT里的文本内容

``` def replace_text(replacements, shapes): """ 替换PPT里的文本内容 """ for shape in shapes: for match, replacement in replacements.items(): match = str(match...