dmlc / gluon-nlp

NLP made easy
https://nlp.gluon.ai/
Apache License 2.0
2.56k stars 538 forks source link

nlp version error #1597

Open IluvRiver opened 1 year ago

IluvRiver commented 1 year ago

Description

(A clear and concise description of what the bug is.) It seems that there is an error in the code due to an import problem. Specifically, the module gluonnlp is being imported, but the module gluonnlp.data.utils is not finding the function _convert_to_unicode that it needs. This may be due to a version compatibility issue or an installation issue.

Error Message

(Paste the complete error message, including stack trace.)

cannot import name '_convert_to_unicode' from 'gluonnlp.data.utils' (/usr/local/lib/python3.10/dist-packages/gluonnlp/data/utils.py)

To Reproduce

(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)

필요 패키지 설치

!pip uninstall mxnet-y !pip install mxnet

!pip install gluonnlp==0.8.0 !pip install tqdm pandas !pip install sentencepiece !pip install transformers !pip install torch

KoBERT 깃허브에서 불러오기

!pip install 'git+https://github.com/SKTBrain/KoBERT.git#egg=kobert_tokenizer&subdirectory=kobert_hf'

!pip install 'git+https://git@github.com/SKTBrain/KoBERT.git@master'

import torch from torch import nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset, DataLoader import gluonnlp as nlp import numpy as np from tqdm import tqdm, tqdm_notebook import pandas as pd

Steps to reproduce

(Paste the commands you ran that produced the error.)

1. 2.

What have you tried to solve it?

1. 2.

Environment

We recommend using our script for collecting the diagnositc information. Run the following command and paste the outputs below:

curl --retry 10 -s https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py | python

# paste outputs here
alexxony commented 10 months ago

나도 똑같아요