Spaces:
Runtime error
Assertion error on executing from datasets import of load_dataset
I am getting the following error in just an datasets import
ModuleNotFoundError Traceback (most recent call last)
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/aiohttp/client_reqrep.py:70
69 try:
---> 70 import cchardet as chardet
71 except ImportError: # pragma: no cover
ModuleNotFoundError: No module named 'cchardet'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
/home/harsh/Fine_tune_Llama_2_7b_chat_as_conversation.ipynb Cell 5 line 3
1 import os
2 import torch
----> 3 from datasets import load_dataset
4 from transformers import (
5 AutoModelForCausalLM,
6 AutoTokenizer,
(...)
11 logging,
12 )
13 from peft import LoraConfig, PeftModel
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/datasets/init.py:43
40 del pyarrow
41 del version
---> 43 from .arrow_dataset import Dataset
44 from .arrow_reader import ReadInstruction
45 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/datasets/arrow_dataset.py:65
62 from requests import HTTPError
64 from . import config
---> 65 from .arrow_reader import ArrowReader
66 from .arrow_writer import ArrowWriter, OptimizedTypedSequence
67 from .download.download_config import DownloadConfig
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/datasets/arrow_reader.py:30
27 import pyarrow as pa
28 import pyarrow.parquet as pq
---> 30 from .download.download_config import DownloadConfig
31 from .naming import _split_re, filenames_for_dataset_split
32 from .table import InMemoryTable, MemoryMappedTable, Table, concat_tables
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/datasets/download/init.py:10
8 from .download_config import DownloadConfig
9 from .download_manager import DownloadManager, DownloadMode
---> 10 from .streaming_download_manager import StreamingDownloadManager
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:18
15 from xml.etree import ElementTree as ET
17 import fsspec
---> 18 from aiohttp.client_exceptions import ClientError
20 from .. import config
21 from ..filesystems import COMPRESSION_FILESYSTEMS
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/aiohttp/init.py:6
3 from typing import Tuple
5 from . import hdrs as hdrs
----> 6 from .client import (
7 BaseConnector as BaseConnector,
8 ClientConnectionError as ClientConnectionError,
9 ClientConnectorCertificateError as ClientConnectorCertificateError,
10 ClientConnectorError as ClientConnectorError,
11 ClientConnectorSSLError as ClientConnectorSSLError,
12 ClientError as ClientError,
13 ClientHttpProxyError as ClientHttpProxyError,
14 ClientOSError as ClientOSError,
15 ClientPayloadError as ClientPayloadError,
16 ClientProxyConnectionError as ClientProxyConnectionError,
17 ClientRequest as ClientRequest,
18 ClientResponse as ClientResponse,
19 ClientResponseError as ClientResponseError,
20 ClientSession as ClientSession,
21 ClientSSLError as ClientSSLError,
22 ClientTimeout as ClientTimeout,
23 ClientWebSocketResponse as ClientWebSocketResponse,
24 ContentTypeError as ContentTypeError,
25 Fingerprint as Fingerprint,
26 InvalidURL as InvalidURL,
27 NamedPipeConnector as NamedPipeConnector,
28 RequestInfo as RequestInfo,
29 ServerConnectionError as ServerConnectionError,
30 ServerDisconnectedError as ServerDisconnectedError,
31 ServerFingerprintMismatch as ServerFingerprintMismatch,
32 ServerTimeoutError as ServerTimeoutError,
33 TCPConnector as TCPConnector,
34 TooManyRedirects as TooManyRedirects,
35 UnixConnector as UnixConnector,
36 WSServerHandshakeError as WSServerHandshakeError,
37 request as request,
38 )
39 from .cookiejar import CookieJar as CookieJar, DummyCookieJar as DummyCookieJar
40 from .formdata import FormData as FormData
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/aiohttp/client.py:59
37 from .abc import AbstractCookieJar
38 from .client_exceptions import (
39 ClientConnectionError as ClientConnectionError,
40 ClientConnectorCertificateError as ClientConnectorCertificateError,
(...)
57 WSServerHandshakeError as WSServerHandshakeError,
58 )
---> 59 from .client_reqrep import (
60 ClientRequest as ClientRequest,
61 ClientResponse as ClientResponse,
62 Fingerprint as Fingerprint,
63 RequestInfo as RequestInfo,
64 _merge_ssl_params,
65 )
66 from .client_ws import ClientWebSocketResponse as ClientWebSocketResponse
67 from .connector import (
68 BaseConnector as BaseConnector,
69 NamedPipeConnector as NamedPipeConnector,
70 TCPConnector as TCPConnector,
71 UnixConnector as UnixConnector,
72 )
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/aiohttp/client_reqrep.py:72
70 import cchardet as chardet
71 except ImportError: # pragma: no cover
---> 72 import charset_normalizer as chardet # type: ignore[no-redef]
75 all = ("ClientRequest", "ClientResponse", "RequestInfo", "Fingerprint")
78 if TYPE_CHECKING: # pragma: no cover
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/charset_normalizer/init.py:23
1 """
2 Charset-Normalizer
3 ~~~~~~~~~~~~~~
(...)
21 :license: MIT, see LICENSE for more details.
22 """
---> 23 from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
24 from charset_normalizer.legacy import detect
25 from charset_normalizer.version import version, VERSION
File ~/miniconda3/envs/harshenv/lib/python3.9/site-packages/charset_normalizer/api.py:10
7 PathLike = Union[str, 'os.PathLike[str]'] # type: ignore
9 from charset_normalizer.constant import TOO_SMALL_SEQUENCE, TOO_BIG_SEQUENCE, IANA_SUPPORTED
---> 10 from charset_normalizer.md import mess_ratio
11 from charset_normalizer.models import CharsetMatches, CharsetMatch
12 from warnings import warn
AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import)
Please help, some 2 weeks ago this code was working but now i dont know what has happened.