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 java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
enum State { | |
NORMAL,SPACE,SINGLE,DOUBLE,ESCAPE | |
} | |
class Extractor { | |
private State state; // 当前状态 |
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 QtQuick 2.12 | |
import QtQuick.Window 2.12 | |
Window { | |
id: msPaint | |
visible: true | |
width: 640 | |
height: 480 | |
title: qsTr("MoeSoftPaint") |
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
from os import makedirs | |
from os.path import dirname, abspath | |
from pathlib import Path | |
from onnxruntime.quantization import quantize_dynamic, QuantType | |
from sentence_transformers import SentenceTransformer, util | |
import torch | |
from torch import nn | |
from transformers.onnx.convert import export_pytorch |
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): |
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
#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
[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
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") |
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 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 |
OlderNewer