Commit 1c62e87b authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Use built-in open().

On Python 3, `open is io.open`.
parent d6eaf4e6
...@@ -21,7 +21,6 @@ import glob ...@@ -21,7 +21,6 @@ import glob
import json import json
import logging import logging
import os import os
from io import open
from typing import List from typing import List
import tqdm import tqdm
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import logging import logging
import os import os
from io import open
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
...@@ -33,7 +33,6 @@ To create the package for pypi. ...@@ -33,7 +33,6 @@ To create the package for pypi.
7. Copy the release notes from RELEASE.md to the tag in github once everything is looking hunky-dory. 7. Copy the release notes from RELEASE.md to the tag in github once everything is looking hunky-dory.
""" """
from io import open
from setuptools import find_packages, setup from setuptools import find_packages, setup
......
...@@ -20,7 +20,6 @@ import copy ...@@ -20,7 +20,6 @@ import copy
import json import json
import logging import logging
import os import os
from io import open
from .file_utils import CONFIG_NAME, cached_path, hf_bucket_url, is_remote_url from .file_utils import CONFIG_NAME, cached_path, hf_bucket_url, is_remote_url
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import argparse import argparse
import logging import logging
from io import open
import torch import torch
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
import argparse import argparse
import logging import logging
from io import open
import torch import torch
......
...@@ -20,7 +20,6 @@ import logging ...@@ -20,7 +20,6 @@ import logging
import os import os
import pickle import pickle
import sys import sys
from io import open
import torch import torch
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import argparse import argparse
import json import json
import logging import logging
from io import open
import numpy import numpy
import torch import torch
......
...@@ -14,7 +14,6 @@ import logging ...@@ -14,7 +14,6 @@ import logging
import math import math
import re import re
import string import string
from io import open
from transformers.tokenization_bert import BasicTokenizer from transformers.tokenization_bert import BasicTokenizer
......
...@@ -14,7 +14,6 @@ import tempfile ...@@ -14,7 +14,6 @@ import tempfile
from contextlib import contextmanager from contextlib import contextmanager
from functools import partial, wraps from functools import partial, wraps
from hashlib import sha256 from hashlib import sha256
from io import open
from urllib.parse import urlparse from urllib.parse import urlparse
import boto3 import boto3
......
...@@ -19,7 +19,6 @@ import copy ...@@ -19,7 +19,6 @@ import copy
import json import json
import logging import logging
import os import os
from io import open
from .configuration_auto import ALL_PRETRAINED_CONFIG_ARCHIVE_MAP from .configuration_auto import ALL_PRETRAINED_CONFIG_ARCHIVE_MAP
from .file_utils import ( from .file_utils import (
......
...@@ -20,7 +20,6 @@ import json ...@@ -20,7 +20,6 @@ import json
import logging import logging
import math import math
import os import os
from io import open
import torch import torch
import torch.nn as nn import torch.nn as nn
......
...@@ -19,7 +19,6 @@ import collections ...@@ -19,7 +19,6 @@ import collections
import logging import logging
import os import os
import unicodedata import unicodedata
from io import open
from .tokenization_utils import PreTrainedTokenizer from .tokenization_utils import PreTrainedTokenizer
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import json import json
import logging import logging
import os import os
from io import open
import regex as re import regex as re
......
...@@ -19,7 +19,6 @@ import json ...@@ -19,7 +19,6 @@ import json
import logging import logging
import os import os
from functools import lru_cache from functools import lru_cache
from io import open
import regex as re import regex as re
......
...@@ -19,7 +19,6 @@ import json ...@@ -19,7 +19,6 @@ import json
import logging import logging
import os import os
import re import re
from io import open
from .tokenization_bert import BasicTokenizer from .tokenization_bert import BasicTokenizer
from .tokenization_utils import PreTrainedTokenizer from .tokenization_utils import PreTrainedTokenizer
......
...@@ -23,7 +23,6 @@ import logging ...@@ -23,7 +23,6 @@ import logging
import os import os
import pickle import pickle
from collections import Counter, OrderedDict from collections import Counter, OrderedDict
from io import open
import numpy as np import numpy as np
......
...@@ -21,7 +21,6 @@ import json ...@@ -21,7 +21,6 @@ import json
import logging import logging
import os import os
import re import re
from io import open
from .file_utils import cached_path, hf_bucket_url, is_remote_url, is_tf_available, is_torch_available from .file_utils import cached_path, hf_bucket_url, is_remote_url, is_tf_available, is_torch_available
......
...@@ -21,7 +21,6 @@ import os ...@@ -21,7 +21,6 @@ import os
import re import re
import sys import sys
import unicodedata import unicodedata
from io import open
import sacremoses as sm import sacremoses as sm
......
...@@ -19,7 +19,6 @@ import collections ...@@ -19,7 +19,6 @@ import collections
import json import json
import logging import logging
import math import math
from io import open
from transformers.tokenization_bert import BasicTokenizer, whitespace_tokenize from transformers.tokenization_bert import BasicTokenizer, whitespace_tokenize
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment