Instructions to use saadamin2k13/byT5_ft_semantic_parser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use saadamin2k13/byT5_ft_semantic_parser with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("saadamin2k13/byT5_ft_semantic_parser") model = AutoModelForSeq2SeqLM.from_pretrained("saadamin2k13/byT5_ft_semantic_parser", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from saadamin2k13/byT5_ft_semantic_parser: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/saadamin2k13/byT5_ft_semantic_parser/resolve/main/README.md
- Command line
-
hf download hf://saadamin2k13/byT5_ft_semantic_parser/README.md
-
curl -L -o README.md https://huggingface.co/saadamin2k13/byT5_ft_semantic_parser/resolve/main/README.md
1.45 kB
| language: | |
| - en | |
| metrics: | |
| - accuracy | |
| library_name: transformers | |
| tags: | |
| - text-generation-inference | |
| # Model Card for Model ID | |
| <!-- Provide a quick summary of what the model is/does. --> | |
| This model card lists fine-tuned byT5 model for the task of Semantic Parsing. | |
| ## Model Details | |
| We worked on a pre-trained byt5-base model and fine-tuned it with the Parallel Meaning Bank dataset (DRS-Text pairs dataset). | |
| Furthermore, we enriched the gold_silver flavors of PMB (release 5.0.0) with different augmentation strategies. | |
| ## Uses | |
| <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> | |
| To use the model, follow the code below for a quick response. | |
| ```python | |
| from transformers import ByT5Tokenizer, T5ForConditionalGeneration | |
| # Initialize the tokenizer and model | |
| tokenizer = ByT5Tokenizer.from_pretrained('saadamin2k13/byT5_ft_semantic_parser', max_length=512) | |
| model = T5ForConditionalGeneration.from_pretrained('saadamin2k13/byT5_ft_semantic_parser') | |
| # Example sentence | |
| example = "This car is black." | |
| # Tokenize and prepare the input | |
| x = tokenizer(example, return_tensors='pt', padding=True, truncation=True, max_length=512)['input_ids'] | |
| # Generate output | |
| output = model.generate(x) | |
| # Decode and print the output text | |
| pred_text = tokenizer.decode(output[0], skip_special_tokens=True, clean_up_tokenization_spaces=False) | |
| print(pred_text) | |