LinkSoul / Chinese-Llama-2-7b-4bit

huggingface.co
Total runs: 84
24-hour runs: 1
7-day runs: -6
30-day runs: 33
Model's Last Updated: August 16 2023
text-generation

Introduction of Chinese-Llama-2-7b-4bit

Model Details of Chinese-Llama-2-7b-4bit

Chinese Llama 2 7B 4bit

全部开源,完全可商用的 中文版 Llama2 模型及中英文 SFT 数据集 ,输入格式严格遵循 llama-2-chat 格式,兼容适配所有针对原版 llama-2-chat 模型的优化。

Chinese LLaMA2 7B

基础演示

Base Demo

在线试玩

Talk is cheap, Show you the Demo.

资源下载

我们使用了中英文 SFT 数据集,数据量 1000 万。

快速测试
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer

# Original version
# model_path = "LinkSoul/Chinese-Llama-2-7b"
# 4 bit version
model_path = "LinkSoul/Chinese-Llama-2-7b-4bit"


tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
if model_path.endswith("4bit"):
    model = AutoModelForCausalLM.from_pretrained(
            model_path,
            load_in_4bit=True,
            torch_dtype=torch.float16,
            device_map='auto'
        )
else:
    model = AutoModelForCausalLM.from_pretrained(model_path).half().cuda()
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)

instruction = """[INST] <<SYS>>\nYou are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe.  Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.

            If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.\n<</SYS>>\n\n{} [/INST]"""

prompt = instruction.format("用英文回答,什么是夫妻肺片?")
generate_ids = model.generate(tokenizer(prompt, return_tensors='pt').input_ids.cuda(), max_new_tokens=4096, streamer=streamer)
相关项目
项目协议

Apache-2.0 license

微信交流群

欢迎加入 微信群

Runs of LinkSoul Chinese-Llama-2-7b-4bit on huggingface.co

84
Total runs
1
24-hour runs
2
3-day runs
-6
7-day runs
33
30-day runs

More Information About Chinese-Llama-2-7b-4bit huggingface.co Model

More Chinese-Llama-2-7b-4bit license Visit here:

https://choosealicense.com/licenses/openrail

Chinese-Llama-2-7b-4bit huggingface.co

Chinese-Llama-2-7b-4bit huggingface.co is an AI model on huggingface.co that provides Chinese-Llama-2-7b-4bit's model effect (), which can be used instantly with this LinkSoul Chinese-Llama-2-7b-4bit model. huggingface.co supports a free trial of the Chinese-Llama-2-7b-4bit model, and also provides paid use of the Chinese-Llama-2-7b-4bit. Support call Chinese-Llama-2-7b-4bit model through api, including Node.js, Python, http.

Chinese-Llama-2-7b-4bit huggingface.co Url

https://huggingface.co/LinkSoul/Chinese-Llama-2-7b-4bit

LinkSoul Chinese-Llama-2-7b-4bit online free

Chinese-Llama-2-7b-4bit huggingface.co is an online trial and call api platform, which integrates Chinese-Llama-2-7b-4bit's modeling effects, including api services, and provides a free online trial of Chinese-Llama-2-7b-4bit, you can try Chinese-Llama-2-7b-4bit online for free by clicking the link below.

LinkSoul Chinese-Llama-2-7b-4bit online free url in huggingface.co:

https://huggingface.co/LinkSoul/Chinese-Llama-2-7b-4bit

Chinese-Llama-2-7b-4bit install

Chinese-Llama-2-7b-4bit is an open source model from GitHub that offers a free installation service, and any user can find Chinese-Llama-2-7b-4bit on GitHub to install. At the same time, huggingface.co provides the effect of Chinese-Llama-2-7b-4bit install, users can directly use Chinese-Llama-2-7b-4bit installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Chinese-Llama-2-7b-4bit install url in huggingface.co:

https://huggingface.co/LinkSoul/Chinese-Llama-2-7b-4bit

Url of Chinese-Llama-2-7b-4bit

Chinese-Llama-2-7b-4bit huggingface.co Url

Provider of Chinese-Llama-2-7b-4bit huggingface.co

LinkSoul
ORGANIZATIONS

Other API from LinkSoul