Instructions to use thealper2/bloom-560m-totto with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thealper2/bloom-560m-totto with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thealper2/bloom-560m-totto")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("thealper2/bloom-560m-totto") model = AutoModelForCausalLM.from_pretrained("thealper2/bloom-560m-totto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thealper2/bloom-560m-totto with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thealper2/bloom-560m-totto" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/bloom-560m-totto", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/thealper2/bloom-560m-totto
- SGLang
How to use thealper2/bloom-560m-totto with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "thealper2/bloom-560m-totto" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/bloom-560m-totto", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "thealper2/bloom-560m-totto" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/bloom-560m-totto", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use thealper2/bloom-560m-totto with Docker Model Runner:
docker model run hf.co/thealper2/bloom-560m-totto
thealper2/bloom-560m-totto
bigscience/bloom-560m fully fine-tuned on GEM/ToTTo for table-to-text generation: given a Wikipedia table with highlighted cells, it writes a one-sentence description of those cells.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "thealper2/bloom-560m-totto"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id).eval()
table = (
"<page_title> List of national independence days </page_title> "
"<table> <cell> Senegal <col_header> Country </col_header> </cell> "
"<cell> 1960 <col_header> Year celebrated </col_header> </cell> </table>"
)
prompt = 'Table:\n{table}\n\nDescription:\n'.format(table=table)
inputs = tokenizer(prompt, return_tensors="pt")
out = model.generate(
**inputs,
max_new_tokens=64,
num_beams=4,
do_sample=False,
pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True).strip())
The prompt format is part of the model: it was trained on Table:\n{table}\n\nDescription:\n followed by the description and EOS, with the loss computed on the description only. Tables are linearized in the standard ToTTo style (<page_title>, <section_title>, <cell>, <col_header>, <row_header>). Feeding a differently formatted prompt will degrade output.
Results
Deterministic beam search (num_beams=4, no sampling) on 1000 examples of the held-out test split. ToTTo's official test split ships without references, so the held-out half of the official validation split is used for reporting.
| Metric | Fine-tuned | bigscience/bloom-560m (zero-shot) |
|---|---|---|
| BLEU | 42.64 | 2.80 |
| ROUGE-1 | 72.88 | 19.68 |
| ROUGE-2 | 51.01 | 9.20 |
| ROUGE-L | 62.59 | 15.63 |
Training
- Base model:
bigscience/bloom-560m(559,214,592 parameters, all of them trained - no adapters) - Data: 30,000 ToTTo training examples, 1,000 for validation
- Epochs: 1.0 | learning rate: 2e-05 (cosine schedule, warmup ratio 0.03)
- Effective batch size: 16 (2 x 8 accumulation)
- Precision: bf16 mixed precision, fp32 master weights | optimizer:
adamw_torch_fused - Max sequence length: 512 tokens
- Final validation loss: 1.1099 | training loss: 1.2376
- Hardware: single consumer GPU, 15.32 GB peak VRAM, 0.88 h for 1,875 steps
Limitations
- English Wikipedia tables only; other domains and languages are out of distribution.
- The model describes what the highlighted cells say, it does not verify them. It can still hallucinate entities or relations that the table does not support, so do not use its output as a factual source without checking.
- It is a 560M-parameter model trained on a subset of ToTTo, not a general-purpose assistant. Outside the prompt format above it behaves like the untuned base model.
- Inherits the base model's biases and its
bigscience-bloom-rail-1.0use restrictions.
Citation
@inproceedings{parikh2020totto,
title = {{ToTTo}: A Controlled Table-To-Text Generation Dataset},
author = {Parikh, Ankur P. and Wang, Xuezhi and Gehrmann, Sebastian and
Faruqui, Manaal and Dhingra, Bhuwan and Yang, Diyi and Das, Dipanjan},
booktitle = {EMNLP},
year = {2020}
}
- Downloads last month
- 21
Model tree for thealper2/bloom-560m-totto
Base model
bigscience/bloom-560mDataset used to train thealper2/bloom-560m-totto
Evaluation results
- BLEU on ToTTo (GEM)test set self-reported42.640
- ROUGE-1 on ToTTo (GEM)test set self-reported72.880
- ROUGE-2 on ToTTo (GEM)test set self-reported51.010
- ROUGE-L on ToTTo (GEM)test set self-reported62.590