Downloads · 30 days
10
14% of all-time downloads
liemo/open-lilm-v2-q4
open-lilm-v2-q4 is a text generation model from liemo. 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.
This is simply a quantized version of open-lilm-v2 without other modification. This model is only intended for research or entertainment purposes as the original model.
Downloads · 30 days
10
14% of all-time downloads
All-time downloads
69
Public
Parameters
6.2B
3.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.9 GB · 100%
How the weights are stored.
U85.7B · 91%
From the Hugging Face model README
This is simply a quantized version of open-lilm-v2 without other modification. This model is only intended for research or entertainment purposes as the original model.
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.
This model can be used with Hugging Face's Transformers library:
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "liemo/open-lilm-v2-q4"
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
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 = quantized_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": "user",
"content": """
INPUT_CONTENT_HERE
"""}
]
result = chat(messages, max_new_tokens=200, temperature=1)
print(result)