mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-04 05:10:06 +06:00
polishing docs: error fixes for clarity (#39042)
* fix duplicate deprecate_models.py * fix duplicate modular_model_converter.py
This commit is contained in:
parent
3abeaba7e5
commit
ae15715df1
@ -31,7 +31,7 @@ def get_last_stable_minor_release():
|
|||||||
url = "https://pypi.org/pypi/transformers/json"
|
url = "https://pypi.org/pypi/transformers/json"
|
||||||
release_data = requests.get(url).json()
|
release_data = requests.get(url).json()
|
||||||
|
|
||||||
# Find the last stable release of of transformers (version below current version)
|
# Find the last stable release of transformers (version below current version)
|
||||||
major_version, minor_version, patch_version, _ = current_version.split(".")
|
major_version, minor_version, patch_version, _ = current_version.split(".")
|
||||||
last_major_minor = f"{major_version}.{int(minor_version) - 1}"
|
last_major_minor = f"{major_version}.{int(minor_version) - 1}"
|
||||||
last_stable_minor_releases = [
|
last_stable_minor_releases = [
|
||||||
|
@ -1490,7 +1490,7 @@ class ModularFileMapper(ModuleMapper):
|
|||||||
suffix = common_partial_suffix(class_name, modeling_bases[0])
|
suffix = common_partial_suffix(class_name, modeling_bases[0])
|
||||||
if len(suffix) > 0 and suffix[0].isupper():
|
if len(suffix) > 0 and suffix[0].isupper():
|
||||||
cased_model_name = class_name.replace(suffix, "")
|
cased_model_name = class_name.replace(suffix, "")
|
||||||
# If both the old model and new model share the last part of their name, is is detected as a common
|
# If both the old model and new model share the last part of their name, is detected as a common
|
||||||
# suffix, but it should not be the case -> use the full name in this case
|
# suffix, but it should not be the case -> use the full name in this case
|
||||||
if len(cased_model_name) < len(cased_default_name) and cased_default_name in class_name:
|
if len(cased_model_name) < len(cased_default_name) and cased_default_name in class_name:
|
||||||
cased_model_name = cased_default_name
|
cased_model_name = cased_default_name
|
||||||
|
Loading…
Reference in New Issue
Block a user