dashscope 1.13.4__py3-none-any.whl → 1.13.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dashscope might be problematic. Click here for more details.
- dashscope/utils/oss_utils.py +12 -5
- dashscope/version.py +1 -1
- {dashscope-1.13.4.dist-info → dashscope-1.13.5.dist-info}/METADATA +1 -1
- {dashscope-1.13.4.dist-info → dashscope-1.13.5.dist-info}/RECORD +8 -8
- {dashscope-1.13.4.dist-info → dashscope-1.13.5.dist-info}/LICENSE +0 -0
- {dashscope-1.13.4.dist-info → dashscope-1.13.5.dist-info}/WHEEL +0 -0
- {dashscope-1.13.4.dist-info → dashscope-1.13.5.dist-info}/entry_points.txt +0 -0
- {dashscope-1.13.4.dist-info → dashscope-1.13.5.dist-info}/top_level.txt +0 -0
dashscope/utils/oss_utils.py
CHANGED
|
@@ -49,7 +49,9 @@ class OssUtils(GetMixin):
|
|
|
49
49
|
"""
|
|
50
50
|
upload_info = cls.get_upload_certificate(model=model, api_key=api_key)
|
|
51
51
|
if upload_info.status_code != HTTPStatus.OK:
|
|
52
|
-
|
|
52
|
+
raise UploadFileException(
|
|
53
|
+
'Get upload certificate failed, code: %s, message: %s' %
|
|
54
|
+
(upload_info.code, upload_info.message))
|
|
53
55
|
upload_info = upload_info.output
|
|
54
56
|
headers = {}
|
|
55
57
|
headers = {'user-agent': get_user_agent()}
|
|
@@ -77,10 +79,11 @@ class OssUtils(GetMixin):
|
|
|
77
79
|
if response.status_code == HTTPStatus.OK:
|
|
78
80
|
return 'oss://' + form_data['key']
|
|
79
81
|
else:
|
|
80
|
-
|
|
81
|
-
'Uploading file: %s to oss failed
|
|
82
|
+
msg = (
|
|
83
|
+
'Uploading file: %s to oss failed, error: %s' %
|
|
82
84
|
(file_path, cls._decode_response_error(response=response)))
|
|
83
|
-
|
|
85
|
+
logger.error(msg)
|
|
86
|
+
raise UploadFileException(msg)
|
|
84
87
|
|
|
85
88
|
@classmethod
|
|
86
89
|
def get_upload_certificate(cls,
|
|
@@ -104,7 +107,11 @@ def check_and_upload(model, elem: dict, key: str, api_key):
|
|
|
104
107
|
is_upload = False
|
|
105
108
|
content = elem[key]
|
|
106
109
|
if content.startswith(FILE_PATH_SCHEMA):
|
|
107
|
-
|
|
110
|
+
parse_result = urlparse(content)
|
|
111
|
+
if parse_result.netloc:
|
|
112
|
+
file_path = parse_result.netloc + unquote_plus(parse_result.path)
|
|
113
|
+
else:
|
|
114
|
+
file_path = unquote_plus(parse_result.path)
|
|
108
115
|
if os.path.exists(file_path):
|
|
109
116
|
file_url = OssUtils.upload(model=model,
|
|
110
117
|
file_path=file_path,
|
dashscope/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '1.13.
|
|
1
|
+
__version__ = '1.13.5'
|
|
@@ -4,7 +4,7 @@ dashscope/deployment.py,sha256=uhlQYOiu1baMQxQnFmRwI6ces0I-_DKp8uej_L0v1eY,4400
|
|
|
4
4
|
dashscope/file.py,sha256=Dv2Fz3DLbcye2uuQxyQwRM7ky27OthouLXIpSQagQy4,3324
|
|
5
5
|
dashscope/finetune.py,sha256=5QlIcnFCfSjN3gn9A2FO0kLUDa9Rx_jSc44ezT3aBEo,5118
|
|
6
6
|
dashscope/model.py,sha256=iuIfal-vOo0yav0HXPdA7f93vd5JNTGIAdCG_WIYkW8,1158
|
|
7
|
-
dashscope/version.py,sha256=
|
|
7
|
+
dashscope/version.py,sha256=0ABC2vXnaJZdF2X2EPQ4t1kt-gJSY-MyWRAgshMFEdk,23
|
|
8
8
|
dashscope/aigc/__init__.py,sha256=s-MCA87KYiVumYtKtJi5IMN7xelSF6TqEU3s3_7RF-Y,327
|
|
9
9
|
dashscope/aigc/code_generation.py,sha256=bizJb3zGZx3pB74FKMIcnOi_6jkxpKgx__6urzqhQ_E,10627
|
|
10
10
|
dashscope/aigc/conversation.py,sha256=_sAWhQjLgJENqRAXh-i2dw8bt_i69fJv9KZYVIi4CEg,14090
|
|
@@ -50,10 +50,10 @@ dashscope/protocol/websocket.py,sha256=z-v6PGx3L4zYBANuC48s7SWSQSwRCDoh0zcfhv9Bf
|
|
|
50
50
|
dashscope/tokenizers/__init__.py,sha256=zRNBe3ONNOA3T2gnxhlG3PTjkVOQBUYotMMJAruyk70,71
|
|
51
51
|
dashscope/tokenizers/tokenization.py,sha256=WhSdiH0Bu-pGQCsJfC91LL_y5tVDzCtQ7tTs2Tox-HY,4543
|
|
52
52
|
dashscope/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
-
dashscope/utils/oss_utils.py,sha256=
|
|
54
|
-
dashscope-1.13.
|
|
55
|
-
dashscope-1.13.
|
|
56
|
-
dashscope-1.13.
|
|
57
|
-
dashscope-1.13.
|
|
58
|
-
dashscope-1.13.
|
|
59
|
-
dashscope-1.13.
|
|
53
|
+
dashscope/utils/oss_utils.py,sha256=zvViqJvmHXAfoRZQ3dbjEMmQ9UzbYFy_J8ptKm_sLbc,5686
|
|
54
|
+
dashscope-1.13.5.dist-info/LICENSE,sha256=Izp5L1DF1Mbza6qojkqNNWlE_mYLnr4rmzx2EBF8YFw,11413
|
|
55
|
+
dashscope-1.13.5.dist-info/METADATA,sha256=cfXqfsPahD46AlYmAnJv79XSb0TdyrDs0sgj7dzdixg,7227
|
|
56
|
+
dashscope-1.13.5.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
57
|
+
dashscope-1.13.5.dist-info/entry_points.txt,sha256=raEp5dOuj8whJ7yqZlDM8WQ5p2RfnGrGNo0QLQEnatY,50
|
|
58
|
+
dashscope-1.13.5.dist-info/top_level.txt,sha256=woqavFJK9zas5xTqynmALqOtlafghjsk63Xk86powTU,10
|
|
59
|
+
dashscope-1.13.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|