Text Generation
Transformers
Safetensors
MLX
llama
code
conversational
Eval Results (legacy)
text-generation-inference
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("mlx-community/granite-8b-code-instruct-8bit")
model = AutoModelForCausalLM.from_pretrained("mlx-community/granite-8b-code-instruct-8bit")
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
mlx-community/granite-8b-code-instruct-8bit
The Model mlx-community/granite-8b-code-instruct-8bit was converted to MLX format from ibm-granite/granite-8b-code-instruct using mlx-lm version 0.12.0.
Use with mlx
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/granite-8b-code-instruct-8bit")
response = generate(model, tokenizer, prompt="hello", verbose=True)
- Downloads last month
- 34
Hardware compatibility
Log In to add your hardware
Quantized
Model tree for mlx-community/granite-8b-code-instruct-8bit
Base model
ibm-granite/granite-8b-code-base-4kDatasets used to train mlx-community/granite-8b-code-instruct-8bit
Evaluation results
- pass@1 on HumanEvalSynthesis(Python)self-reported57.900
- pass@1 on HumanEvalSynthesis(Python)self-reported52.400
- pass@1 on HumanEvalSynthesis(Python)self-reported58.500
- pass@1 on HumanEvalSynthesis(Python)self-reported43.300
- pass@1 on HumanEvalSynthesis(Python)self-reported48.200
- pass@1 on HumanEvalSynthesis(Python)self-reported37.200
- pass@1 on HumanEvalSynthesis(Python)self-reported53.000
- pass@1 on HumanEvalSynthesis(Python)self-reported42.700
- pass@1 on HumanEvalSynthesis(Python)self-reported52.400
- pass@1 on HumanEvalSynthesis(Python)self-reported36.600
- pass@1 on HumanEvalSynthesis(Python)self-reported43.900
- pass@1 on HumanEvalSynthesis(Python)self-reported16.500
- pass@1 on HumanEvalSynthesis(Python)self-reported39.600
- pass@1 on HumanEvalSynthesis(Python)self-reported40.900
- pass@1 on HumanEvalSynthesis(Python)self-reported48.200
- pass@1 on HumanEvalSynthesis(Python)self-reported41.500
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlx-community/granite-8b-code-instruct-8bit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)