Downloads · 30 days
22
1% of all-time downloads
FreedomIntelligence/HuatuoGPT2-7B-4bits
HuatuoGPT2-7B-4bits is a text generation model from FreedomIntelligence. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
<div align="center" <h1 HuatuoGPT2-7B-4bits </h1 </div
Downloads · 30 days
22
1% of all-time downloads
All-time downloads
1.8K
Public
Repo size
5.4 GB
Likes
4
Public
Click a slice to open those files.
.bin5.4 GB · 100%
From the Hugging Face model README
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.generation.utils import GenerationConfig
tokenizer = AutoTokenizer.from_pretrained("FreedomIntelligence/HuatuoGPT2-7B-4bits", use_fast=True, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("FreedomIntelligence/HuatuoGPT2-7B-4bits", device_map="auto", torch_dtype="auto", trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained("FreedomIntelligence/HuatuoGPT2-7B-4bits")
messages = []
messages.append({"role": "user", "content": "肚子疼怎么办?"})
response = model.HuatuoChat(tokenizer, messages)
print(response)