mirror of https://github.com/explosion/spaCy.git
Optionally append lang for packaged model name (#7417)
* Add empty lines at the end of Python files * Only prepend the lang code if it's not there already * Update spacy/cli/package.py * fix whitespace stripping
This commit is contained in:
parent
df3444421a
commit
95e3cf576b
spacy/cli
|
@ -112,7 +112,9 @@ def package(
|
|||
msg.fail("Invalid pipeline meta.json")
|
||||
print("\n".join(errors))
|
||||
sys.exit(1)
|
||||
model_name = meta["lang"] + "_" + meta["name"]
|
||||
model_name = meta["name"]
|
||||
if not model_name.startswith(meta['lang'] + "_"):
|
||||
model_name = f"{meta['lang']}_{model_name}"
|
||||
model_name_v = model_name + "-" + meta["version"]
|
||||
main_path = output_dir / model_name_v
|
||||
package_path = main_path / model_name
|
||||
|
@ -294,7 +296,7 @@ def setup_package():
|
|||
|
||||
if __name__ == '__main__':
|
||||
setup_package()
|
||||
""".strip()
|
||||
""".lstrip()
|
||||
|
||||
|
||||
TEMPLATE_MANIFEST = """
|
||||
|
@ -314,4 +316,4 @@ __version__ = get_model_meta(Path(__file__).parent)['version']
|
|||
|
||||
def load(**overrides):
|
||||
return load_model_from_init_py(__file__, **overrides)
|
||||
""".strip()
|
||||
""".lstrip()
|
||||
|
|
Loading…
Reference in New Issue