How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="haidlir/bloom-chatml-id")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("haidlir/bloom-chatml-id")
model = AutoModelForCausalLM.from_pretrained("haidlir/bloom-chatml-id")
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

Notebook Info

Reference:

Task: Chat or Conversational

Input: User's prompt containing chat templated text in string format

Output: Model's generated text in string format

Experiment:

  • Use bos_token and eos_token to replace <|im_start|> and <|im_end|> in ChatML. (Inspired by: https://asmirnov.xyz/doppelganger)
  • Use left padding and left truncation to conform to max_length.
  • Set max_length = 256 in the training process, which consumes 33.7 GB of memory.

Notebook:

Downloads last month
6
Safetensors
Model size
1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train haidlir/bloom-chatml-id

Space using haidlir/bloom-chatml-id 1