Commit Graph

18 Commits

Author SHA1 Message Date
suluyana
7e0eacb0ec fix: forward download kwargs in HF patcher snapshot_download calls (#1762)
* fix: forward download kwargs in HF patcher snapshot_download calls

Honor local_files_only, cache_dir, token, and revision/code_revision when
resolving from_pretrained and cross-repo auto_map dynamic modules.

Co-authored-by: Cursor <cursoragent@cursor.com>

* style: fix yapf/flake8 formatting in hf util tests

Co-authored-by: Cursor <cursoragent@cursor.com>

* style: yapf format legacy cache reuse helpers

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: suluyan <suluyan.sly@aliabab-inc.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-22 17:00:09 +08:00
suluyana
ac61e0bd8f [Fix]dynamic module auto map double dash (#1761)
* fix: resolve cross-repo auto_map when cache paths contain --

modelscope_hub 0.1.x layout embeds -- in local dirs; rejoining that
path into class_reference broke transformers' split("--"). Pass the
local snapshot as pretrained_model_name_or_path with a bare class name
instead, and stop mutating the args tuple in place.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: reject empty model name in trusted owner cache paths

check_model_from_owner_group treated paths like iic--/snapshots/v1 as
trusted because split('--') still yields two parts. Require both owner
and name segments to be non-empty.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: cover remote pretrained args tuple rebuild in dynamic module patcher

The TypeError from mutating *args was already fixed with the auto_map
double-dash change; add an explicit regression test for that branch.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: derive valid module names from snapshot revision paths

Path(model_dir).stem on revisions like v1.0.4 produced v1.0, so
importlib treated it as package v1 and raised ModuleNotFoundError.
Use the owner--name (+ revision) segment and sanitize to an identifier.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: cover module naming for dotted snapshot revisions

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: handle pretrained_model_name_or_path passed via kwargs

When the arg is only in kwargs, downloading and then forcing a
positional overwrite caused a duplicate-keyword TypeError. Resolve and
update kwargs or args consistently for both the download and cross-repo
branches.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix lint

* fix(docker): catch JSONDecodeError when querying Docker Hub tags

Non-JSON Hub responses (block pages, 5xx HTML) would bypass URLError
handling and crash json.load; surface them as RuntimeError instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: suluyan <suluyan.sly@aliabab-inc.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 19:49:53 +08:00
tastelikefeet
9379504fd3 Fix some bugs (#1746) 2026-07-07 11:26:14 +08:00
tastelikefeet
918a808dc2 compat with tf5.0 (#1618) 2026-03-07 22:40:43 +08:00
tastelikefeet
dbbf268e70 Fix downloading repos in automap (#1630) 2026-03-02 11:33:50 +08:00
Xingjun.Wang
4f867bfe80 Fix: deprecate delete_repo, delete_model and delete_dataset due to token a… (#1588) 2026-01-12 11:51:46 +08:00
Xingjun.Wang
055496c597 Fix CI 2025-08-07 19:26:32 +08:00
tastelikefeet
556aa76dc3 fix pyyaml according to: https://github.com/Anchor0221/CVE-2025-50460 (#1428) 2025-08-01 22:04:44 +08:00
tastelikefeet
a91f19ea54 Support downloading exact file for hf wrapper (#1323) 2025-04-30 14:57:59 +08:00
xingjun.wxj
10aa2c6bd8 add login for HFUtilTest 2025-03-27 22:42:48 +08:00
suluyana
57044b9c88 feat: compatible with hf_pipeline (#1221)
compatible with hf_pipeline
2025-02-21 15:49:39 +08:00
tastelikefeet
1cf7f4ff52 fix create_commit login (#1210) 2025-02-06 18:22:29 +08:00
tastelikefeet
f74433f6b2 Add more patches for hf (#1160) 2025-02-06 11:09:37 +08:00
tastelikefeet
96e33878b4 lint code (#970) 2024-09-02 10:16:35 +08:00
yuze.zyz
8b5a5bd1e3 fix 2024-09-01 18:37:01 +08:00
mulin.lyh
d30ef8b202 fix huggingface position_ids compatible issue
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/14406558
* fix compatible issues

* fix transformer compatible issue

* skip case for huggingface link issue

* fix hf autotokenlizer case

* Merge branch 'fix_ci_issue' of http://gitlab.alibaba-inc.com/Ali-MaaS/MaaS-lib into fix_ci_issue
2023-10-24 15:18:55 +08:00
mulin.lyh
23f1f474bf Merge branch 'master-github' into master-merge-github925
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/14164566
2023-09-26 21:15:41 +08:00
wenmeng zhou
64203e89ee Compatibility for huggingface transformers (#391) 2023-07-24 20:53:27 +08:00