-
Notifications
You must be signed in to change notification settings - Fork 27.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFoundError: No module named 'torch_xla' #5907
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 |
ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds |
You should use model.generate(input_ids=inputs['input_ids'], attention_mask=inputs['attention_mask']) pinging @mrm8488 for exact |
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 ;) |
git clone https://github.com/huggingface/transformers.git
pip install ./transformers 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 </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 |
I already did it. |
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 |
Model card: 61e8be9 |
@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 |
The main issue is solved, closing this for now. Feel free to re-open if the problem persists. |
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")
The text was updated successfully, but these errors were encountered: