Voice et bot modif

This commit is contained in:
pi 2026-06-16 17:09:34 +00:00
parent 189d56026b
commit 7333a22bcd
10774 changed files with 634644 additions and 933308 deletions

View file

@ -1,4 +1,3 @@
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -17,10 +16,11 @@
import os
import subprocess
import sys
from collections.abc import Generator
from contextlib import contextmanager
from io import StringIO
from pathlib import Path
from typing import IO, Generator, Optional, Union
from typing import IO
from .logging import get_logger
@ -51,8 +51,8 @@ def capture_output() -> Generator[StringIO, None, None]:
def run_subprocess(
command: Union[str, list[str]],
folder: Optional[Union[str, Path]] = None,
command: str | list[str],
folder: str | Path | None = None,
check=True,
**kwargs,
) -> subprocess.CompletedProcess:
@ -84,8 +84,7 @@ def run_subprocess(
return subprocess.run(
command,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
capture_output=True,
check=check,
encoding="utf-8",
errors="replace", # if not utf-8, replace char by <20>
@ -96,8 +95,8 @@ def run_subprocess(
@contextmanager
def run_interactive_subprocess(
command: Union[str, list[str]],
folder: Optional[Union[str, Path]] = None,
command: str | list[str],
folder: str | Path | None = None,
**kwargs,
) -> Generator[tuple[IO[str], IO[str]], None, None]:
"""Run a subprocess in an interactive mode in a context manager.