Instructions to use learn-abc/html-model-tinyllama-chat-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use learn-abc/html-model-tinyllama-chat-bnb-4bit with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("learn-abc/html-model-tinyllama-chat-bnb-4bit", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio new
How to use learn-abc/html-model-tinyllama-chat-bnb-4bit with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for learn-abc/html-model-tinyllama-chat-bnb-4bit to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for learn-abc/html-model-tinyllama-chat-bnb-4bit to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for learn-abc/html-model-tinyllama-chat-bnb-4bit to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="learn-abc/html-model-tinyllama-chat-bnb-4bit", max_seq_length=2048, )
Fine-tuned TinyLlama for JSON Extraction
This repository contains a fine-tuned version of the unsloth/tinyllama-chat-bnb-4bit model, specifically trained for extracting product information from HTML snippets and outputting it in a JSON format.
Model Details
- Base Model:
unsloth/tinyllama-chat-bnb-4bit - Fine-tuning Method: LoRA (Low-Rank Adaptation)
- Trained on: A custom dataset
json_extraction_dataset_500.jsonof HTML product snippets and their corresponding JSON representations.
Usage
This model can be used for tasks involving structured data extraction from HTML content.
Loading the model
You can load the model and tokenizer using the transformers library:
from unsloth import FastLanguageModel
import torch
import json
model_name = "learn-abc/html-model-tinyllama-chat-bnb-4bit" # Hugging face model repo ID
max_seq_length = 2048 # Or your chosen sequence length
dtype = None # Auto detection
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = model_name,
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "user", "content": "Extract the product information:\n<div class='product'><h2>iPad Air</h2><span class='price'>$1344</span><span class='category'>audio</span><span class='brand'>Dell</span></div>"}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
).to("cuda") # Or "cpu" if not using GPU
outputs = model.generate(
input_ids=inputs,
max_new_tokens=256,
use_cache=True,
temperature=0.7,
do_sample=True,
top_p=0.9,
)
response = tokenizer.batch_decode(outputs)[0]
print(response)
Uploaded model
- Developed by: learn-abc
- License: apache-2.0
- Finetuned from model : unsloth/tinyllama-chat-bnb-4bit
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
