Revert "Use code on the Hub from another repo" (#22813)

Revert "Use code on the Hub from another repo (#22698)"

This reverts commit ea7b0a539a.
This commit is contained in:
Sylvain Gugger
2023-04-17 14:22:13 -04:00
committed by GitHub
parent e13d6ef7dc
commit 50caa20628
12 changed files with 66 additions and 98 deletions

View File

@@ -727,8 +727,9 @@ def pipeline(
" set the option `trust_remote_code=True` to remove this error."
)
class_ref = targeted_task["impl"]
module_file, class_name = class_ref.split(".")
pipeline_class = get_class_from_dynamic_module(
class_ref, model, revision=revision, use_auth_token=use_auth_token
model, module_file + ".py", class_name, revision=revision, use_auth_token=use_auth_token
)
else:
normalized_task, targeted_task, task_options = check_task(task)