dashscope 1.20.6__py3-none-any.whl → 1.20.7__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 +35 -29
- dashscope/version.py +1 -1
- {dashscope-1.20.6.dist-info → dashscope-1.20.7.dist-info}/METADATA +1 -1
- {dashscope-1.20.6.dist-info → dashscope-1.20.7.dist-info}/RECORD +8 -8
- {dashscope-1.20.6.dist-info → dashscope-1.20.7.dist-info}/LICENSE +0 -0
- {dashscope-1.20.6.dist-info → dashscope-1.20.7.dist-info}/WHEEL +0 -0
- {dashscope-1.20.6.dist-info → dashscope-1.20.7.dist-info}/entry_points.txt +0 -0
- {dashscope-1.20.6.dist-info → dashscope-1.20.7.dist-info}/top_level.txt +0 -0
dashscope/utils/oss_utils.py
CHANGED
|
@@ -124,36 +124,42 @@ def upload_file(model: str, upload_path: str, api_key: str):
|
|
|
124
124
|
def check_and_upload(model, elem: dict, api_key):
|
|
125
125
|
is_upload = False
|
|
126
126
|
for key, content in elem.items():
|
|
127
|
+
# support video:[images] for qwen2-vl
|
|
128
|
+
is_list = isinstance(content, list)
|
|
129
|
+
contents = content if is_list else [content]
|
|
130
|
+
|
|
127
131
|
if key in ['image', 'video', 'audio', 'text']:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
parse_result.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
132
|
+
for i, content in enumerate(contents):
|
|
133
|
+
if content.startswith(FILE_PATH_SCHEMA):
|
|
134
|
+
parse_result = urlparse(content)
|
|
135
|
+
if parse_result.netloc:
|
|
136
|
+
file_path = parse_result.netloc + unquote_plus(
|
|
137
|
+
parse_result.path)
|
|
138
|
+
else:
|
|
139
|
+
file_path = unquote_plus(parse_result.path)
|
|
140
|
+
if os.path.exists(file_path):
|
|
141
|
+
file_url = OssUtils.upload(model=model,
|
|
142
|
+
file_path=file_path,
|
|
143
|
+
api_key=api_key)
|
|
144
|
+
if file_url is None:
|
|
145
|
+
raise UploadFileException(
|
|
146
|
+
'Uploading file: %s failed' % content)
|
|
147
|
+
contents[i] = file_url
|
|
148
|
+
is_upload = True
|
|
149
|
+
else:
|
|
150
|
+
raise InvalidInput('The file: %s is not exists!' %
|
|
151
|
+
file_path)
|
|
152
|
+
elif not content.startswith('http'):
|
|
153
|
+
if os.path.exists(content):
|
|
154
|
+
file_url = OssUtils.upload(model=model,
|
|
155
|
+
file_path=content,
|
|
156
|
+
api_key=api_key)
|
|
157
|
+
if file_url is None:
|
|
158
|
+
raise UploadFileException(
|
|
159
|
+
'Uploading file: %s failed' % content)
|
|
160
|
+
contents[i] = file_url
|
|
161
|
+
is_upload = True
|
|
162
|
+
elem[key] = contents if is_list else contents[0]
|
|
157
163
|
|
|
158
164
|
return is_upload
|
|
159
165
|
|
dashscope/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '1.20.
|
|
1
|
+
__version__ = '1.20.7'
|
|
@@ -3,7 +3,7 @@ dashscope/cli.py,sha256=amegoTkGOs6TlHMdoo4JVOqBePo3lGs745rc7leEyrE,24020
|
|
|
3
3
|
dashscope/files.py,sha256=QgJjwhtn9F548nCA8jD8OvE6aQEj-20hZqJgYXsUdQU,3930
|
|
4
4
|
dashscope/model.py,sha256=UPOn1qMYFhX-ovXi3BMxZEBk8qOK7WLJOYHMbPZwYBo,1440
|
|
5
5
|
dashscope/models.py,sha256=1-bc-Ue68zurgu_y6RhfFr9uzeQMF5AZq-C32lJGMGU,1224
|
|
6
|
-
dashscope/version.py,sha256=
|
|
6
|
+
dashscope/version.py,sha256=gQu6hE6vB8heRmWsFGU7BDL4DsK0RiBB-W17n8BWDPA,23
|
|
7
7
|
dashscope/aigc/__init__.py,sha256=s-MCA87KYiVumYtKtJi5IMN7xelSF6TqEU3s3_7RF-Y,327
|
|
8
8
|
dashscope/aigc/code_generation.py,sha256=KAJVrGp6tiNFBBg64Ovs9RfcP5SrIhrbW3wdA89NKso,10885
|
|
9
9
|
dashscope/aigc/conversation.py,sha256=xRoJlCR-IXHjSdkDrK74a9ut1FJg0FZhTNXZAJC18MA,14231
|
|
@@ -77,10 +77,10 @@ dashscope/tokenizers/tokenization.py,sha256=G6cSEmVLr3pjXUC3EOU9ot8MYxNnOQ4wOB2m
|
|
|
77
77
|
dashscope/tokenizers/tokenizer.py,sha256=y6P91qTCYo__pEx_0VHAcj9YECfbUdRqZU1fdGTjF4o,1154
|
|
78
78
|
dashscope/tokenizers/tokenizer_base.py,sha256=REDhzRyDT13iequ61-a6_KcTy0GFKlihQve5HkyoyRs,656
|
|
79
79
|
dashscope/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
|
-
dashscope/utils/oss_utils.py,sha256=
|
|
81
|
-
dashscope-1.20.
|
|
82
|
-
dashscope-1.20.
|
|
83
|
-
dashscope-1.20.
|
|
84
|
-
dashscope-1.20.
|
|
85
|
-
dashscope-1.20.
|
|
86
|
-
dashscope-1.20.
|
|
80
|
+
dashscope/utils/oss_utils.py,sha256=TSBh7MJK4ZH40Mxd8wNEsG8nQLNhQjWRjW3itHsvoZ0,7023
|
|
81
|
+
dashscope-1.20.7.dist-info/LICENSE,sha256=Izp5L1DF1Mbza6qojkqNNWlE_mYLnr4rmzx2EBF8YFw,11413
|
|
82
|
+
dashscope-1.20.7.dist-info/METADATA,sha256=BBs0rgqbL8wqwlTSjnlM8flMtvKrjGOhiOIsjZCT-xM,6661
|
|
83
|
+
dashscope-1.20.7.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
84
|
+
dashscope-1.20.7.dist-info/entry_points.txt,sha256=e9C3sOf9zDYL0O5ROEGX6FT8w-QK_kaGRWmPZDHAFys,49
|
|
85
|
+
dashscope-1.20.7.dist-info/top_level.txt,sha256=woqavFJK9zas5xTqynmALqOtlafghjsk63Xk86powTU,10
|
|
86
|
+
dashscope-1.20.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|