From f1b17e54a7af40b880c9acfb1a599a44c5db2471 Mon Sep 17 00:00:00 2001 From: Qian Liu Date: Thu, 10 Mar 2022 05:28:45 +0000 Subject: [PATCH] Update README.md --- README.md | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 2fbe4f7..35a52a9 100644 --- a/README.md +++ b/README.md @@ -17,34 +17,8 @@ TAPEX is based on the BART architecture, the transformer encoder-encoder (seq2se ## Intended Uses -You can use the raw model for simulating neural SQL execution, i.e., employ TAPEX to execute a SQL query on a given table. However, the model is mostly meant to be fine-tuned on a supervised dataset. Currently TAPEX can be fine-tuned to tackle table question answering tasks and table fact verification tasks. See the [model hub](https://huggingface.co/models?search=tapex) to look for fine-tuned versions on a task that interests you. - -### How to Use - -Here is how to use this model in transformers: - -```python -from transformers import TapexTokenizer, BartForConditionalGeneration -import pandas as pd - -tokenizer = TapexTokenizer.from_pretrained("microsoft/tapex-large") -model = BartForConditionalGeneration.from_pretrained("microsoft/tapex-large") - -data = { - "year": [1896, 1900, 1904, 2004, 2008, 2012], - "city": ["athens", "paris", "st. louis", "athens", "beijing", "london"] -} -table = pd.DataFrame.from_dict(data) - -# tapex accepts uncased input since it is pre-trained on the uncased corpus -query = "select year where city = beijing" -encoding = tokenizer(table=table, query=query, return_tensors="pt") - -outputs = model.generate(**encoding) - -print(tokenizer.batch_decode(outputs, skip_special_tokens=True)) -# ['2008'] -``` +⚠️ This model checkpoint is **ONLY** used for fine-tuining on downstream tasks, and you **CANNOT** use this model for simulating neural SQL execution, i.e., employ TAPEX to execute a SQL query on a given table. The one that can neurally execute SQL queries is at [here](https://huggingface.co/microsoft/tapex-large-sql-execution). +> This separation of two models for two kinds of intention is because of a known issue in BART large, and we recommend readers to see [this comment](https://github.com/huggingface/transformers/issues/15559#issuecomment-1062880564) for more details. ### How to Fine-tuning