Downloads · 30 days
13
4% of all-time downloads
0xtaipoian/open-lilm
open-lilm is a text generation model from 0xtaipoian. 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.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
13
4% of all-time downloads
All-time downloads
299
Public
Parameters
6.1B
24.3 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors24.3 GB · 100%
From the Hugging Face model README
Warning: Due to the nature of the training data, this model is highly likely to return violent, racist and discriminative content. DO NOT USE IN PRODUCTION ENVIRONMENT.
Inspired by another project. This is a finetuned model based on CantoneseLLMChat-v0.5 which everybody can use without the need for a Mac with 128GB RAM.
Following the same principle, we filtered 377,595 post and reply pairs in LIHKG forum from the LIHKG Dataset.
To avoid political complications, the dataset will not be made publicly available.
Due to the nature of an online and anonymous forum, the training data and the model are full of rude, violent, racist and discriminative language. This model is only intended for research or entertainment purposes.
The comments on LIHKG also tend to be very short. Thus the model cannot generate anything more than a line.
You can run it on Colab or anywhere you want based on the code:
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, LlamaTokenizer, GenerationConfig, pipeline
from peft import PeftModel, PeftMixedModel
import torch
model_name = "0xtaipoian/open-lilm"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
quantization_config=bnb_config,
)
def chat(messages, temperature=0.9, max_new_tokens=200):
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt').to('cuda:0')
output_ids = model.generate(input_ids, max_new_tokens=max_new_tokens, temperature=temperature, do_sample=True)
chatml = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
print(chatml)
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=False)
return response
messages = [
# {"role": "system", "content": ""},
{"role": "user",
"content":
"""
密陽44人輪姦案」受害女隔20年現身:時間停在2004,不記得
"""}]
result = chat(messages, max_new_tokens=200, temperature=1)
print(result)
The model was trained for ~15 hours on a single NVIDIA H100 96GB HBM2e GPU with LLaMA-Factory. We only used 1 GPU as this is our first run on our brand-new H100 server. We are still testing different configurations.
The following hyperparameters were used during training:
To test out different configs, we trained another model using QLoRA for ~30 hours on a single NVIDIA H100 96GB HBM2e GPU with LLaMA-Factory.
The following hyperparameters were used during training: