From eeefcc1acc626cfc793119723f7d91efe92fc4fe Mon Sep 17 00:00:00 2001 From: "mulin.lyh" Date: Thu, 20 Jun 2024 15:37:51 +0800 Subject: [PATCH] move pandas import to function --- modelscope/hub/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modelscope/hub/api.py b/modelscope/hub/api.py index 5ed4ed99..a5a6ade5 100644 --- a/modelscope/hub/api.py +++ b/modelscope/hub/api.py @@ -18,7 +18,6 @@ from typing import Dict, List, Optional, Tuple, Union from urllib.parse import urlencode import json -import pandas as pd import requests from requests import Session from requests.adapters import HTTPAdapter, Retry @@ -820,6 +819,8 @@ class HubApi: """ import hashlib from tqdm import tqdm + import pandas as pd + out_path = os.path.join(out_path, hashlib.md5(url.encode(encoding='UTF-8')).hexdigest()) if mode == DownloadMode.FORCE_REDOWNLOAD and os.path.exists(out_path): os.remove(out_path)