mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-12-05 05:38:31 +08:00
把 tqdm.autonotebook 换成tqdm.auto
This commit is contained in:
parent
f466c502c5
commit
e209925256
@ -20,10 +20,10 @@ except ImportError:
|
||||
from urllib.request import urlopen
|
||||
from urllib.parse import urlparse
|
||||
try:
|
||||
from tqdm import tqdm
|
||||
except ImportError:
|
||||
tqdm = None # defined below
|
||||
|
||||
from tqdm.auto import tqdm
|
||||
except:
|
||||
from ..core.utils import _pseudo_tqdm as tqdm
|
||||
|
||||
# matches bfd8deac from resnet18-bfd8deac.pth
|
||||
HASH_REGEX = re.compile(r'-([a-f0-9]*)\.')
|
||||
|
||||
|
@ -9,7 +9,7 @@ import numpy as np
|
||||
import torch
|
||||
|
||||
try:
|
||||
from tqdm.autonotebook import tqdm
|
||||
from tqdm.auto import tqdm
|
||||
except:
|
||||
from ..core.utils import _pseudo_tqdm as tqdm
|
||||
|
||||
|
@ -311,7 +311,7 @@ import torch
|
||||
from torch import nn
|
||||
|
||||
try:
|
||||
from tqdm.autonotebook import tqdm
|
||||
from tqdm.auto import tqdm
|
||||
except:
|
||||
from .utils import _pseudo_tqdm as tqdm
|
||||
|
||||
|
@ -20,7 +20,10 @@ from .file_reader import _read_csv, _read_json, _read_conll
|
||||
|
||||
|
||||
def _download_from_url(url, path):
|
||||
from tqdm import tqdm
|
||||
try:
|
||||
from tqdm.auto import tqdm
|
||||
except:
|
||||
from ..core.utils import _pseudo_tqdm as tqdm
|
||||
import requests
|
||||
|
||||
"""Download file"""
|
||||
|
@ -9,7 +9,7 @@ import torch
|
||||
import math
|
||||
|
||||
try:
|
||||
from tqdm.autonotebook import tqdm
|
||||
from tqdm.auto import tqdm
|
||||
except:
|
||||
from ..core.utils import _pseudo_tqdm as tqdm
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user