Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

コードベースを大規模にリファクタリングし、ライブラリ (Python パッケージ) としてほかの Python コードから利用できるように改善 #92

Merged
merged 69 commits into from
Mar 11, 2024

Commits on Mar 6, 2024

  1. Fix: ignore .venv/

    tsukumijima committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    e4cd4f8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f26def4 View commit details
    Browse the repository at this point in the history
  3. Refactor: rewrote Japanese natural language processing code imported …

    …from server_editor.py
    
    The logic has not been changed, only renaming, splitting and moving modules on a per-function basis.
    Existing code will be left in place for the time being to avoid breaking the training code, which is not subject to refactoring this time.
    tsukumijima committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    918d168 View commit details
    Browse the repository at this point in the history
  4. Refactor: moved the user dictionary implementation ported from VOICEV…

    …OX to style_bert_vits2/text_processing/japanese/user_dict/
    tsukumijima committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    46c83cf View commit details
    Browse the repository at this point in the history
  5. Refactor: moved commons.py to style_bert_vits2/models/ and added type…

    … definitions and comments
    tsukumijima committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    9546495 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f880641 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1936344 View commit details
    Browse the repository at this point in the history
  8. Fix: import error

    tsukumijima committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    ca4c03c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a52fda7 View commit details
    Browse the repository at this point in the history
  10. Refactor: moved model, attentions definitions and inference code to s…

    …tyle_bert_vits2/models/
    
    The code has not yet been cleaned up, just moved.
    tsukumijima committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    89825e6 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Configuration menu
    Copy the full SHA
    e826faf View commit details
    Browse the repository at this point in the history
  2. Refactor: add style_bert_vits2/text_processing/bert_models.py to hold…

    … loaded BERT models/tokenizer and replace all from_pretrained() to load_model/load_tokenizer
    tsukumijima committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    c3c0dd8 View commit details
    Browse the repository at this point in the history
  3. Refactor: moved the module for extracting BERT features from text in …

    …each language to style_bert_vits2/text_processing/(language)/bert_feature.py
    tsukumijima committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    62919e9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4f11b01 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b011683 View commit details
    Browse the repository at this point in the history
  6. Refactor: style_bert_vits2/text_processing/cleaner.py integrated into…

    … style_bert_vits2/text_processing/__init__.py
    
    This was often used in 3 function sets and felt like a wasteful division with few lines.
    tsukumijima committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    def6d88 View commit details
    Browse the repository at this point in the history
  7. Remove: remove webui.py, which is no longer maintained in Style-Bert-…

    …VITS2
    
    Since app.py and server_editor.py already exist as alternative Web UI, there is no need to revive webui.py in the future.
    tsukumijima committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    1450bfd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d364018 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f8f798d View commit details
    Browse the repository at this point in the history
  10. Fix: import error

    tsukumijima committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    bffd5a6 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e57cfbf View commit details
    Browse the repository at this point in the history
  12. Add: empty __init__.py

    tsukumijima committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    70f8d53 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2024

  1. Configuration menu
    Copy the full SHA
    3f07c25 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4d5c537 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    da7747c View commit details
    Browse the repository at this point in the history
  4. Remove: Ruff

    I have determined that this is excessive for this project at this time.
    tsukumijima committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    4a3519c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8add1b4 View commit details
    Browse the repository at this point in the history
  6. Refactor: rename text_processing to nlp

    "text_processing" is clearer, but the import statement is longer.
    "nlp" is shorter and makes it clear that it is natural language processing.
    tsukumijima committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    fac4f9a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7546793 View commit details
    Browse the repository at this point in the history
  8. Fix: import error

    pyopenjtalk_worker.initialize() has the side effect of starting another process and should not be executed automatically on import.
    tsukumijima committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    5de4884 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e2daa55 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a672aee View commit details
    Browse the repository at this point in the history
  11. Refactor: split style_bert_vits2.nlp.chinese package

    Configured so that the same public function is exported from the module with the same name for each language.
    tsukumijima committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    df68771 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    766699e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c1f2862 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    fe7e31e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    67ff310 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c915215 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    8fad591 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    7f0b252 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    a0b5cd3 View commit details
    Browse the repository at this point in the history
  20. Refactor: replace utils.HParams with HyperParameters Pydantic model

    HyperParameters is largely a drop-in replacement for utils.HParams, which ensures type safety for hyper-parameters.
    tsukumijima committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    a84783a View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    6b19eac View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    b9e486e View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    30ea08d View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    d22a11e View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    b98fecb View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    717ba79 View commit details
    Browse the repository at this point in the history
  27. Refactor: add type hints to attentions.py / modules.py / transforms.py

    I didn't add docstring because it is very technical code and I don't understand what is being implemented.
    tsukumijima committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    e1fad54 View commit details
    Browse the repository at this point in the history
  28. Refactor: add type hints to models.py / models_jp_extra.py

    I didn't add docstring because it is very technical code and I don't understand what is being implemented.
    tsukumijima committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    8feef04 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2024

  1. Refactor: change execution location of pyopenjtalk.initialize()

    Considering library design, this function with many side effects should not be executed in a library.
    tsukumijima committed Mar 9, 2024
    Configuration menu
    Copy the full SHA
    c594f7e View commit details
    Browse the repository at this point in the history
  2. Merge pull request litagin02#91 from kale4eat/dev-pyopenjtalk-worker

    openjtalkプロセス間通信のタイムアウト延長
    litagin02 authored Mar 9, 2024
    Configuration menu
    Copy the full SHA
    8fdeea1 View commit details
    Browse the repository at this point in the history
  3. Refactor: separate module for utilities related to loading/saving che…

    …ckpoints and safetensors
    tsukumijima committed Mar 9, 2024
    Configuration menu
    Copy the full SHA
    98ab8e7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    61e2a1d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    96d2210 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1d32091 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0a74fe5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a79b191 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2024

  1. Refactor: when pyopenjtalk_worker is called without initialization, c…

    …ontinue processing without a worker
    
    When using style-bert-vits2 as a library, the requirement to be able to launch it in multiple processes may not be necessary. Also, if the library is embedded and exe-ed using PyInstaller or similar, it is difficult to make pyopenjtalk_worker run in a separate process.
    Therefore, we changed it so that the worker is used only when it is explicitly initialized.
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    b7d7c78 View commit details
    Browse the repository at this point in the history
  2. Refactor: rename Model / ModelHolder to TTSModel / TTSModelHolder for…

    … clarification and add comments to each method
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    d2fd378 View commit details
    Browse the repository at this point in the history
  3. Add: test code for style-bert-vits2 as a library

    By executing "hatch run test:test", you can check whether the test passes in all Python 3.9 to 3.12 environments.
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    afff154 View commit details
    Browse the repository at this point in the history
  4. Fix: problem with test failures

    Style-Bert-VITS2 has been reported to not work with some PyTorch 2.2 series, but Python 3.12 is only supported in Torch >= 2.2, so Python 3.12 support is not provided for the time being
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    84b1dbe View commit details
    Browse the repository at this point in the history
  5. Improve: test code

    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    cdc47a9 View commit details
    Browse the repository at this point in the history
  6. Add: VSCode settings

    Enabling type checking with Pylance.
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    00bf496 View commit details
    Browse the repository at this point in the history
  7. Refactor: don't keep models in bert_feature module for each language

    BERT models and tokenizers are already stored and managed in the bert_models module and should not be stored here.
    In addition, since there may be situations where the user would like to use cpu instead of mps for inference when using it as a library, the automatic switching process to mps was removed.
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    9c23363 View commit details
    Browse the repository at this point in the history
  8. Fix: clearly include Pydantic v2 in the dependencies

    The Pydantic models in the library are written for Pydantic v2 and will not work with Pydantic v1.
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    733a9d8 View commit details
    Browse the repository at this point in the history
  9. Improve: switch pyworld to pyworld-prebuilt and enable it by default

    Prebuilt wheels for almost every OS/architecture (except musl) are now available on PyPI, eliminating the need for a build environment.
    ref: https://pypi.org/project/pyworld-prebuilt/
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    be265d4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    859d940 View commit details
    Browse the repository at this point in the history
  11. Refactor: TTSModelInfo changed from TypedDict to Pydantic model

    Pydantic models are more robust and properties can be accessed by dots.
    tsukumijima committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    7f02b0f View commit details
    Browse the repository at this point in the history