ImportError: cannot import name 'AutoModelForQuestionAnswering' from 'transformers

See original GitHub issue

Hi friends,

I would like to use transformers library. But while import I received this error.

This code:

from transformers import AutoTokenizer, AutoModelForQuestionAnswering, pipeline
import torch
 # LOAD MODEL
tokenizer = AutoTokenizer.from_pretrained("savasy/bert-base-turkish-squad")
model = AutoModelForQuestionAnswering.from_pretrained("savasy/bert-base-turkish-squad")

Error

ImportError: cannot import name ‘AutoModelForQuestionAnswering’ from ‘transformers’ (C:\Users\oguzk\anaconda3\lib\site-packages\transformers_init_.py)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
OguzKircicekcommented, Jun 22, 2020

I installed pytorch library.

3reactions
AfaqHasanlicommented, May 31, 2020

Thank you. I solved.

How did you solve it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name 'AutoModelWithLMHead ...
This is literally all the code that I am trying to run: from transformers import ...
Read more >
cannot import name 'get_scheduler' from 'transformers ...
Hi, I'm new to Transformer models, just following the tutorials. ... ImportError: cannot import name 'get_scheduler' from 'transformers'.
Read more >
cannot import name 'TFAutoModel' from 'transformers'
ImportError : cannot import name 'TFAutoModel' from 'transformers'. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On May 29, ......
Read more >
Import Errors - Google Groups
If I import transformers, I get a similar ImportError but the traceback ... ImportError: cannot import name 'NullHandler' from partially ...
Read more >
no module named 'tokenizers' - You.com | The AI Search ...
File "E:\work\pycharm\transformers-master\src\transformers\tokenization_bert.py", line 24, in from tokenizers import BertWordPieceTokenizer ImportError: No ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found