Run this model with HF Jobs

Run allenai/tailor on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/allenai/tailor. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/allenai/tailor on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use from the
Use from the
Transformers library
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("allenai/tailor")
model = AutoModelForSeq2SeqLM.from_pretrained("allenai/tailor", device_map="auto")
Quick Links

Tailor

Model description

This is a ported version of Tailor, the general-purpose counterfactual generator. For more code release, please refer to this github page.

How to use

from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM

model_path = "allenai/tailor"
generator = pipeline("text2text-generation", 
    model=AutoModelForSeq2SeqLM.from_pretrained(model_path), 
    tokenizer=AutoTokenizer.from_pretrained(model_path),
    framework="pt", device=0)

prompt_text = "[VERB+active+past: comfort | AGENT+complete: the doctor | PATIENT+partial: athlete | LOCATIVE+partial: in] <extra_id_0> , <extra_id_1> <extra_id_2> <extra_id_3> ."
generator(prompt_text, max_length=200)

BibTeX entry and citation info

@misc{ross2021tailor,
      title={Tailor: Generating and Perturbing Text with Semantic Controls}, 
      author={Alexis Ross and Tongshuang Wu and Hao Peng and Matthew E. Peters and Matt Gardner},
      year={2021},
      eprint={2107.07150},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2107.07150},
}
Downloads last month
532
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Spaces using allenai/tailor 2

Paper for allenai/tailor