diff --git a/.github/workflows/reuse-image-build.yml b/.github/workflows/reuse-image-build.yml index e04c4800c..bca7616a1 100644 --- a/.github/workflows/reuse-image-build.yml +++ b/.github/workflows/reuse-image-build.yml @@ -21,7 +21,7 @@ on: default: 'docker-build-xeon' outputs: image_repo: - description: "The image reposity used for the image build" + description: "The image repository used for the image build" value: ${{ jobs.mega-image-build.outputs.image_repo }} image_tag: description: "The image tag used for the image build" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85e7e6913..f568b8b90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: end-of-file-fixer files: (.*\.(py|md|rst|yaml|yml|json|ts|js|html|svelte|sh))$ @@ -24,6 +24,8 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace files: (.*\.(py|rst|cmake|yaml|yml|json|ts|js|html|svelte|sh))$ + - id: mixed-line-ending + args: [--fix=lf] - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.5 @@ -100,21 +102,21 @@ repos: - prettier@3.2.5 - repo: https://github.com/psf/black.git - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black files: (.*\.py)$ - repo: https://github.com/asottile/blacken-docs - rev: 1.16.0 + rev: 1.18.0 hooks: - id: blacken-docs args: [--line-length=120, --skip-errors] additional_dependencies: - - black==24.3.0 + - black==24.4.2 - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell args: [-w] @@ -122,7 +124,7 @@ repos: - tomli - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.5 + rev: v0.5.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --no-cache] diff --git a/AudioQnA/deprecated/docker/tts/config.py b/AudioQnA/deprecated/docker/tts/config.py index bf79ebc37..6530f2017 100644 --- a/AudioQnA/deprecated/docker/tts/config.py +++ b/AudioQnA/deprecated/docker/tts/config.py @@ -1,101 +1,101 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -# -# -# This script is adapted from -# https://github.com/RVC-Boss/GPT-SoVITS/blob/main/api.py -# which is under the MIT license -# -# Copyright (c) 2024 RVC-Boss -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -import os -import sys - -import torch - -sovits_path = "" -gpt_path = "" -is_half_str = os.environ.get("is_half", "True") -is_half = True if is_half_str.lower() == "true" else False -is_share_str = os.environ.get("is_share", "False") -is_share = True if is_share_str.lower() == "true" else False - -cnhubert_path = "GPT_SoVITS/pretrained_models/chinese-hubert-base" -bert_path = "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large" -pretrained_sovits_path = "GPT_SoVITS/pretrained_models/s2G488k.pth" -pretrained_gpt_path = "GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt" - -exp_root = "logs" -python_exec = sys.executable or "python" -if torch.cuda.is_available(): - infer_device = "cuda" -else: - infer_device = "cpu" - -webui_port_main = 9874 -webui_port_uvr5 = 9873 -webui_port_infer_tts = 9872 -webui_port_subfix = 9871 - -api_port = 9880 - -if infer_device == "cuda": - gpu_name = torch.cuda.get_device_name(0) - if ( - ("16" in gpu_name and "V100" not in gpu_name.upper()) - or "P40" in gpu_name.upper() - or "P10" in gpu_name.upper() - or "1060" in gpu_name - or "1070" in gpu_name - or "1080" in gpu_name - ): - is_half = False - -if infer_device == "cpu": - is_half = False - use_bf16 = False - - -class Config: - def __init__(self): - self.sovits_path = sovits_path - self.gpt_path = gpt_path - self.is_half = is_half - self.use_bf16 = use_bf16 - - self.cnhubert_path = cnhubert_path - self.bert_path = bert_path - self.pretrained_sovits_path = pretrained_sovits_path - self.pretrained_gpt_path = pretrained_gpt_path - - self.exp_root = exp_root - self.python_exec = python_exec - self.infer_device = infer_device - - self.webui_port_main = webui_port_main - self.webui_port_uvr5 = webui_port_uvr5 - self.webui_port_infer_tts = webui_port_infer_tts - self.webui_port_subfix = webui_port_subfix - - self.api_port = api_port +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# +# +# This script is adapted from +# https://github.com/RVC-Boss/GPT-SoVITS/blob/main/api.py +# which is under the MIT license +# +# Copyright (c) 2024 RVC-Boss +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import os +import sys + +import torch + +sovits_path = "" +gpt_path = "" +is_half_str = os.environ.get("is_half", "True") +is_half = True if is_half_str.lower() == "true" else False +is_share_str = os.environ.get("is_share", "False") +is_share = True if is_share_str.lower() == "true" else False + +cnhubert_path = "GPT_SoVITS/pretrained_models/chinese-hubert-base" +bert_path = "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large" +pretrained_sovits_path = "GPT_SoVITS/pretrained_models/s2G488k.pth" +pretrained_gpt_path = "GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt" + +exp_root = "logs" +python_exec = sys.executable or "python" +if torch.cuda.is_available(): + infer_device = "cuda" +else: + infer_device = "cpu" + +webui_port_main = 9874 +webui_port_uvr5 = 9873 +webui_port_infer_tts = 9872 +webui_port_subfix = 9871 + +api_port = 9880 + +if infer_device == "cuda": + gpu_name = torch.cuda.get_device_name(0) + if ( + ("16" in gpu_name and "V100" not in gpu_name.upper()) + or "P40" in gpu_name.upper() + or "P10" in gpu_name.upper() + or "1060" in gpu_name + or "1070" in gpu_name + or "1080" in gpu_name + ): + is_half = False + +if infer_device == "cpu": + is_half = False + use_bf16 = False + + +class Config: + def __init__(self): + self.sovits_path = sovits_path + self.gpt_path = gpt_path + self.is_half = is_half + self.use_bf16 = use_bf16 + + self.cnhubert_path = cnhubert_path + self.bert_path = bert_path + self.pretrained_sovits_path = pretrained_sovits_path + self.pretrained_gpt_path = pretrained_gpt_path + + self.exp_root = exp_root + self.python_exec = python_exec + self.infer_device = infer_device + + self.webui_port_main = webui_port_main + self.webui_port_uvr5 = webui_port_uvr5 + self.webui_port_infer_tts = webui_port_infer_tts + self.webui_port_subfix = webui_port_subfix + + self.api_port = api_port diff --git a/ChatQnA/docker/ui/react/src/assets/opea-icon-black.svg b/ChatQnA/docker/ui/react/src/assets/opea-icon-black.svg index d4e5cfda9..5c96dc762 100644 --- a/ChatQnA/docker/ui/react/src/assets/opea-icon-black.svg +++ b/ChatQnA/docker/ui/react/src/assets/opea-icon-black.svg @@ -1,39 +1,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +