--- inference: parameters: max_new_tokens: 65 license: apache-2.0 language: - en metrics: - bleu - f1 - perplexity widget: - text: " Yes. You need to notify POSTE assicura. female 30 and 45 cartographer Joanna form Good evening, can you clarify what types of people can't be insured with Poste Assicura, as stated in document_0? Certainly, according to document_0, people who are or have been affected by alcoholism, drug addiction, and HIV infection with or without AIDS cannot be insured. What happens if I am currently a policyholder with Poste Assicura and I develop alcoholism? Do I need to notify them? " --- # Model Card for Flan-T5 Large Emotions This is a Flan-T5-large based model finetuned on the POSTE tasks using only the emotion data as additional input signals. For signals that are not available, please add the respective tag nonetheless. Consider the example from the inference API on the right as a starting point. **Regarding the Output of the inference widget on the right:** I just shows that the model can be load and how the input should look like. The generation might look a bit weird, since it contains the predicted intent, the slots, and the model response, but the inference api removes all special tokens during postprocessing. ### Model Sources - **Repository:** [Flan-T5-large](https://huggingface.co/google/flan-t5-large) ## How to Get Started with the Model ```python import torch from transformers import (AutoModelForSeq2SeqLM, AutoTokenizer) torch_device = "cuda" if torch.cuda.is_available() else "cpu" tokenizer = AutoTokenizer.from_pretrained(model_path) model = AutoModelForSeq2SeqLM.from_pretrained(model_path, pad_token_id=tokenizer.eos_token_id).to(torch_device) input = """ Hi, I need help with parcel choice. Can you do that? """ input_enc = tokenizer.encode(input, truncation = True, return_tensors='pt').to(torch_device)) output = model.generate(model_inputs, generation_config, max_new_tokens=75) output_dec = tokenizer.decode(output[0]) '''The output should look like ... ... ...''' special_toks = r'||' special_toks = re.findall(special_toks, output) splits = re.split(special_toks, output)[1:] for special_tok, text in zip(special_toks, splits): if len(text) > 0: print(f'{special_tok}: {text}') ```