We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Windows10、AnacondaでBERTを使用していたら、fugashiに代わっているようで下記のエラーとなった。
from sentence_transformers import SentenceTransformer from sentence_transformers import models transformer = models.BERT('cl-tohoku/bert-base-japanese-whole-word-masking') で
------------------- ERROR DETAILS ------------------------ arguments: [b'fugashi', b'-C', b'-d', b'C:UsersnwAnaconda3envsPyTorchCUDA10_1libsite-packagesipadicdicdir', b'-r', b'C:UsersnwAnaconda3envsPyTorchCUDA10_1libsite-packagesipadicdicdirmecabrc'] error message: param.cpp(69) [ifs] no such file or directory: C:UsersnwAnaconda3envsPyTorchCUDA10_1libsite-packagesipadicdicdirmecabrc ---------------------------------------------------------- RuntimeError: Failed initializing MeCab
となった。
そこで、transformersパッケージのtokenization_bert_japanese.pyの252行目に mecabrc = os.path.join(dic_dir, "mecabrc") mecab_option = "-d {} -r {} ".format(dic_dir, mecabrc) + mecab_option mecab_option = mecab_option.replace('\','/') replaceを追加し、事無きを得たように見える。 修正はこれでよいのだろうか。
The text was updated successfully, but these errors were encountered:
ご報告ありがとうございます。
問題の原因はshlexにあるみたいです。quoteされてない\が消えてしまいます。パスがquoteされてないせいで他のエラーも起きたので、修正PRは既にtransformersの方でマージされていますがリリースはまだです。
\
huggingface/transformers#7142
以上で起動できたらそれでも問題ありませんがPRの修正内容は下記です。これだとスペースのあるパスでも正しく処理されます。
mecab_option = '-d "{}" -r "{}" '.format(dic_dir, mecabrc) + mecab_option
Sorry, something went wrong.
修正PRは既にマージされたので一応クローズします。
No branches or pull requests
Windows10、AnacondaでBERTを使用していたら、fugashiに代わっているようで下記のエラーとなった。
from sentence_transformers import SentenceTransformer
from sentence_transformers import models
transformer = models.BERT('cl-tohoku/bert-base-japanese-whole-word-masking')
で
となった。
そこで、transformersパッケージのtokenization_bert_japanese.pyの252行目に
mecabrc = os.path.join(dic_dir, "mecabrc")
mecab_option = "-d {} -r {} ".format(dic_dir, mecabrc) + mecab_option
mecab_option = mecab_option.replace('\','/')
replaceを追加し、事無きを得たように見える。
修正はこれでよいのだろうか。
The text was updated successfully, but these errors were encountered: