ModuleNotFoundError: No module named 'torch_xla'
Author: lalitkishorevyas
Pull request: no

from transformers import AutoTokenizer, AutoModelWithLMHead

tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-wikiSQL-sql-to-en")



model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-wikiSQL-sql-to-en")

Comments:
Hi @vyaslkv , what is your transformers version ? I tried this from master branch and it worked.

'3.0.2' Thanks for the quick reply, which version worked for you

I also tried with the master branch by uninstalling the transformers and then using the repo


worked!! Thanks @patil-suraj :)

can you give me an example how to use this a short one

<img width="1138" alt="Screenshot 2020-07-20 at 7 07 12 PM" src="https://user-images.githubusercontent.com/33617789/87943880-46e07900-cabc-11ea-85e1-c98e8462ac0f.png">


ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds


You should use `.generate` method for generation. 
```python3
model.generate(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask'])
```

pinging @mrm8488  for exact `generate` arguments.

<img width="1166" alt="Screenshot 2020-07-20 at 8 55 41 PM" src="https://user-images.githubusercontent.com/33617789/87955457-68952c80-cacb-11ea-889d-95de35eb4cc0.png">


is this correct? generating the text out of it the tokenizer decode part?

I will write a in the model card the exact arguments to use it ASAP and post it here.

Also @vyaslkv  it would nice if you post code instead of screenshot so we can copy paste and try the code faster ;)

```sh
git clone https://github.com/huggingface/transformers.git
pip install ./transformers
```
```python
from transformers import AutoModelWithLMHead, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-wikiSQL-sql-to-en")
model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-wikiSQL-sql-to-en")

def get_explanation(query):
  input_text = "translante Sql to English: %s 
" % query
  features = tokenizer([input_text], return_tensors='pt')

  output = model.generate(input_ids=features['input_ids'], 
               attention_mask=features['attention_mask'])
  
  return tokenizer.decode(output[0])

query = "SELECT COUNT Params form model where location=HF-Hub"

get_explanation(query)
```

@mrm8488 can you also make something like nlp to sql

@mrm8488 it doesn't work for longer queries or is there any particular format I should give

> @mrm8488 can you also make something like nlp to sql

I already did it. 

> @mrm8488 it doesn't work for longer queries or is there any particular format I should give

The max number of f tokens is 128 but I am currently working on the 256 version

@mrm8488 can you send me the link of nlp to sql

https://huggingface.co/mrm8488/t5-base-finetuned-wikiSQL-sql-to-en

Model card: https://github.com/huggingface/transformers/commit/61e8be9940096ce763872c8d1479965511d0b472

@mrm8488 I think this is sql to English not English to SQL correct me If I am wrong

English to SQL is t5-base-finetuned-wikiSQL or English to SQL is t5-small-finetuned-wikiSQL

https://github.com/mrm8488/shared_colab_notebooks/blob/master/T5_finetuned_wikiSQL_demo.ipynb

The main issue is solved, closing this for now. Feel free to re-open if the problem persists.