UnBIAS-LLama2-Debiaser-Chat-QLoRA

作者 newsmediabias · 下载 385 · 点赞 0 · 更新 2023-11-04

from transformers import AutoTokenizer

import transformers

import torch

model = "newsmediabias/UnBIAS-LLama2-Debiaser-Chat-QLoRA"

tokenizer = AutoTokenizer.from_pretrained(model)

pipeline = transformers.pipeline(

    "text-generation",
    
    model=model,
    
    torch_dtype=torch.float16,
    
    device_map="auto",
)

sys_message = "Task:""

prompt=""

intput_text=""

sequences = pipeline(

    intput_text,
    
    do_sample=True,
    
    top_k=10,
    
    num_return_sequences=1,
    
    eos_token_id=tokenizer.eos_token_id,
    
    max_length=len(prompt)+100,
)

res=sequences[0]['generated_text']

模型信息

该模型卡暂无预览图和文字说明。以下信息来自 Hugging Face。

作者 newsmediabias
类型—
基础模型—
标签—
下载385
点赞0
更新时间2023-11-04
Hugging Face https://huggingface.co/newsmediabias/UnBIAS-LLama2-Debiaser-Chat-QLoRA