This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from collections import deque | |
# 可自定义的垃圾文件规则配置 | |
RULES = ( | |
{ | |
"name": "DS_Store files", | |
"match": lambda n: n == ".DS_Store", | |
"condition": lambda e: e.stat().st_size <= 1024**2, # 1MB | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Mandatory = $true)] | |
[string]$PixivZipPath | |
) | |
# 检查 ffmpeg 是否可用 | |
function Check-FFmpeg { | |
$ffmpegPath = Get-Command ffmpeg -ErrorAction SilentlyContinue | |
if (-not $ffmpegPath) { | |
Write-Error "ffmpeg is not installed or not in PATH." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 安装依赖: | |
# pip install opencv-contrib-python | |
import numpy as np | |
import cv2 | |
import os | |
from cv2.ximgproc import guidedFilter | |
input_dir = input('请输入存放输入图像的目录:') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gradio as gr | |
import mdtex2html | |
import torch | |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig | |
from transformers.generation.utils import GenerationConfig | |
# 模型路径 | |
MODEL_PATH = 'Qwen/Qwen-7B-Chat' | |
CONTEXT_SIZE = 8192 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import torch | |
import streamlit as st | |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig | |
from transformers.generation.utils import GenerationConfig | |
st.set_page_config(page_title="Baichuan-13B-Chat") | |
st.title("Baichuan-13B-Chat") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "player" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
cpal = "0.13.5" | |
ffmpeg-next = "5.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "player.h" | |
using namespace std; | |
void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uint32 frameCount) { | |
AVAudioFifo* fifo = reinterpret_cast<AVAudioFifo*>(pDevice->pUserData); | |
av_audio_fifo_read(fifo, &pOutput, frameCount); | |
(void) pInput; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PIL import Image | |
# 定义源目录和目标目录 | |
source_dir = r"D:\dataset\before" | |
target_dir = r"D:\dataset\after" | |
# 遍历源目录下的所有图片文件 | |
for filename in os.listdir(source_dir): | |
# 打开图片文件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use https://github.com/harishanand95/diffusers to export | |
from pathlib import Path | |
import torch | |
import torch.nn as nn | |
from diffusers import StableDiffusionPipeline, LMSDiscreteScheduler, DiffusionPipeline | |
from transformers import CLIPTextModel | |
class VQEncoder(nn.Module): |
NewerOlder