Downloads · 30 days
20
1% of all-time downloads
gonced8/godel-multiwoz
godel-multiwoz is a machine learning model from gonced8. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as gpl-3.0.
Pretrained model: GODEL-v11-base-seq2seq
Downloads · 30 days
20
1% of all-time downloads
All-time downloads
2.2K
Public
Parameters
223M
1.8 GB on disk
Likes
4
Public
Click a slice to open those files.
.bin892 MB · 50%
From the Hugging Face model README
Pretrained model: GODEL-v1_1-base-seq2seq
Fine-tuning dataset: MultiWOZ 2.2
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("gonced8/godel-multiwoz")
model = AutoModelForSeq2SeqLM.from_pretrained("gonced8/godel-multiwoz")
# Encoder input
context = [
"USER: I need train reservations from norwich to cambridge",
"SYSTEM: I have 133 trains matching your request. Is there a specific day and time you would like to travel?",
"USER: I'd like to leave on Monday and arrive by 18:00.",
]
input_text = " EOS ".join(context[-5:]) + " => "
model_inputs = tokenizer(
input_text, max_length=512, truncation=True, return_tensors="pt"
)["input_ids"]
# Decoder input
answer_start = "SYSTEM: "
decoder_input_ids = tokenizer(
"<pad>" + answer_start,
max_length=256,
truncation=True,
add_special_tokens=False,
return_tensors="pt",
)["input_ids"]
# Generate
output = model.generate(
model_inputs, decoder_input_ids=decoder_input_ids, max_length=256
)
output = tokenizer.decode(
output[0], clean_up_tokenization_spaces=True, skip_special_tokens=True
)
print(output)
# SYSTEM: TR4634 arrives at 17:35. Would you like me to book that for you?