使用Peft庫(kù)微調(diào)基座模型(比如LLaMA-7B)后會(huì)得到Lora參數(shù)模塊,將基座模型與Lora參數(shù)合并后才能得到完整的微調(diào)后的大模型文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-611950.html
# Copyright 2023 Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional
from peft import PeftModel
import fire
import torch
import tqdm
import transformers
@torch.inference_mode()
def merge(
path_zhixi,
path_lora,
p
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-611950.html
到了這里,關(guān)于Peft庫(kù)使用技巧(一):合并基座模型與Lora模型【使用Peft庫(kù)微調(diào)基座模型(比如LLaMA-7B)后會(huì)得到Lora參數(shù)模塊,將基座模型與Lora參數(shù)合并后才能得到完整的微調(diào)后的大模型】的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!