Downloads · 30 days
29
1% of all-time downloads
StoryGold/bella-v1.0-13b
bella-v1.0-13b is a machine learning model from StoryGold. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Finetuned on LLaVA 1.6 Vicuna 13B on CADCoder dataset to convert image to CadQuery code.
Downloads · 30 days
29
1% of all-time downloads
All-time downloads
3.1K
Public
Parameters
13.4B
26.7 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors26.7 GB · 100%
From the Hugging Face model README
Finetuned on LLaVA 1.6 Vicuna 13B on CADCoder dataset to convert image to CadQuery code.
The model was evaluated on the 100 example test split of the CADCODER/GenCAD-Code dataset.
| Metric | Score |
|---|---|
| Intersection over Union (IoU) | 0.7505 |
| Valid Generated Solid Rate | 0.98 |
| ROUGE-L | 0.8454 |
| BLEU | 0.7456 |
import torch
from transformers import AutoProcessor, LlavaNextForConditionalGeneration
from PIL import Image
import os
from datasets import load_dataset
model_path = "StoryGold/bella-v1.0-13b"
dataset_name = "CADCODER/GenCAD-Code"
dataset = load_dataset(dataset_name, split='test', streaming=True)
example = next(iter(dataset))
image = example['image']
prompt_text = example['prompt']
ground_truth_code = example['cadquery']
print("Dataset example loaded successfully.")
print(f"Prompt: '{prompt_text}'")
model = LlavaNextForConditionalGeneration.from_pretrained(
model_path,
torch_dtype=torch.bfloat16,
device_map="auto")
processor = AutoProcessor.from_pretrained(model_path)
chat_template = (
"A chat between a curious user and an artificial intelligence assistant. "
"The assistant gives helpful, detailed, and polite answers to the user's questions. "
f"USER: <image>\n{prompt_text} ASSISTANT:"
)
inputs = processor(text=chat_template, images=image, return_tensors="pt").to(model.device)
with torch.inference_mode():
output_ids = model.generate(**inputs, max_new_tokens=4096, do_sample=False)
output_text = processor.decode(output_ids[0], skip_special_tokens=True)