pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
一条命令即可
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
一条命令即可
ComfyUI/custom_nodes 目录(CMD 命令行下)git clone https://github.com/ltdrdata/ComfyUI-Manager comfyui-manager (执行)到 ComfyUI/custom_nodes 目录(CMD 命令行下)
到 ComfyUI/custom_nodes目录(CMD 命令行下)git clone https://github.com/yolain/ComfyUI-Easy-Use.git
cd ComfyUI-Easy-Use
pip install -r requirements.txt
到 ComfyUI/custom_nodes目录(CMD 命令行下)git clone
git clone https://github.com/yolain/ComfyUI-Easy-Use
#2. 安装依赖
双击install.bat安装依赖
use \app\model\Staff; // 模型类
// 1. 取出原记录
$old = Staff::find($id)->toArray(); // 也可以用 get()
// 2. 去掉主键(自增id)
unset($old['id']);
// 3. 插入新记录
$newId = Staff::insertGetId($old); // 返回新的主键值
conda create --name unsloth_env \
python=3.11 \
pytorch-cuda=12.1 \
pytorch cudatoolkit xformers -c pytorch -c nvidia -c xformers \
-y
conda activate unsloth_env
pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
pip install --no-deps trl peft accelerate bitsandbytes
pip install --upgrade pip
pip install "unsloth[cu121-torch240] @ git+https://github.com/unslothai/unsloth.git"
unsloth的使用非常简单,主要分为以下几个步骤:
from unsloth import FastLanguageModel
from unsloth import is_bfloat16_supported
import torch
from trl import SFTTrainer
from transformers import TrainingArgumentsrom datasets import load_dataset
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/llama-3-8b-bnb-4bit",
max_seq_length = 2048,
dtype = None,
load_in_4bit = True,
)
model = FastLanguageModel.get_peft_model(
model,
r = 16,
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",],
lora_alpha = 16,
lora_dropout = 0,
bias = "none",
use_gradient_checkpointing = "unsloth",
random_state = 3407,
max_seq_length = 2048,
)
trainer = SFTTrainer(
model = model,
train_dataset = dataset,
dataset_text_field = "text",
max_seq_length = 2048,
tokenizer = tokenizer,
args = TrainingArguments(
per_device_train_batch_size = 2,
gradient_accumulation_steps = 4,
warmup_steps = 10,
max_steps = 60,
fp16 = not is_bfloat16_supported(),
bf16 = is_bfloat16_supported(),
logging_steps = 1,
output_dir = "outputs",
optim = "adamw_8bit",
seed = 3407,
),
)
trainer.train()
return $this->success("ok",null,['id'=>$info]);
AJAX
{
"code":1,
"msg":"ok",
"data":{"id":"9"},
"url":"http:\/\/test.acfun.org.cn\/portal\/money\/get_id.html?id=69",
"wait":3}