Instructions to use 425GMM/bart-base-aslg-gloss with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 425GMM/bart-base-aslg-gloss with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="425GMM/bart-base-aslg-gloss")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("425GMM/bart-base-aslg-gloss") model = AutoModelForSeq2SeqLM.from_pretrained("425GMM/bart-base-aslg-gloss", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 425GMM/bart-base-aslg-gloss with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "425GMM/bart-base-aslg-gloss" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "425GMM/bart-base-aslg-gloss", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/425GMM/bart-base-aslg-gloss
- SGLang
How to use 425GMM/bart-base-aslg-gloss 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 "425GMM/bart-base-aslg-gloss" \ --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": "425GMM/bart-base-aslg-gloss", "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 "425GMM/bart-base-aslg-gloss" \ --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": "425GMM/bart-base-aslg-gloss", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use 425GMM/bart-base-aslg-gloss with Docker Model Runner:
docker model run hf.co/425GMM/bart-base-aslg-gloss
BART-base fine-tuned for English -> ASL gloss (ASLG-PC12)
facebook/bart-base fine-tuned on the training split of the ASLG-PC12 English-ASL gloss parallel
corpus. Input is a lowercased English sentence; output is an upper-case ASL gloss sequence in the
corpus's conventions (X- pronouns, DESC- modifiers).
This model is one of the systems in a small project comparing grammar-constrained decoding (xgrammar) with unconstrained decoding for gloss generation. Code, grammars and evaluation scripts: https://github.com/TheRealGioviok/asl-gloss-nlp
Training
| Base model | facebook/bart-base |
| Data | training split of the Kaggle redistribution of ASLG-PC12 (87,710 pairs, no official split; deduplicated and re-split 80/10/10 with seed 42 in the project) |
| Epochs | 3 |
| Effective batch size | 32 |
| Learning rate | 3e-5 |
| Max length | 128 tokens (source and target) |
| Steps | 6,084 |
Weights are stored in fp16 (the evaluation in the project also ran in fp16).
Results (1,000-sentence test sample, greedy decoding)
| Decoding | BLEU | chrF | Exact match | Sequence validity |
|---|---|---|---|---|
| Unconstrained | 76.7 | 93.3 | 44.5% | 48.6% |
| Constrained (grammar v3) | 73.2 | 85.9 | 42.8% | 100% |
| Constrained + copy rule (v3) | 74.1 | 86.3 | 44.5% | 100% |
"Sequence validity" is the share of outputs whose every token is in the closed gloss vocabulary.
Usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
repo = "425GMM/bart-base-aslg-gloss"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSeq2SeqLM.from_pretrained(repo)
src = "we should behave outside european waters in just the same way as we do at home ."
ids = tok(src, return_tensors="pt")
out = model.generate(**ids, max_new_tokens=128)
print(tok.decode(out[0], skip_special_tokens=True))
Source sentences in ASLG-PC12 are lowercased with spaces before punctuation; feed the model text in the same form.
Limitations
ASLG-PC12 glosses are rule-generated from Europarl text, not produced by signers. The model learns those rules; it is not a general English-to-ASL translator and scores do not transfer to human-annotated gloss corpora.
- Downloads last month
- -
Model tree for 425GMM/bart-base-aslg-gloss
Base model
facebook/bart-base