mirror of
https://github.com/DrewThomasson/ebook2audiobook.git
synced 2026-01-10 06:18:02 -05:00
...
This commit is contained in:
5
app.py
5
app.py
@@ -1,9 +1,12 @@
|
||||
import argparse, socket, multiprocessing, sys
|
||||
import argparse, socket, multiprocessing, sys, warnings
|
||||
|
||||
from lib.conf import *
|
||||
from lib.lang import default_language_code
|
||||
from lib.models import TTS_ENGINES, default_fine_tuned, default_engine_settings
|
||||
|
||||
warnings.filterwarnings("ignore", category=SyntaxWarning)
|
||||
warnings.filterwarnings("ignore", category=UserWarning, module="jieba._compat")
|
||||
|
||||
def init_multiprocessing():
|
||||
if sys.platform.startswith("darwin"):
|
||||
try:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import os, warnings
|
||||
import os
|
||||
import numpy as np
|
||||
import librosa
|
||||
|
||||
@@ -7,8 +7,6 @@ from pyannote.audio.pipelines import VoiceActivityDetection
|
||||
from lib.conf import tts_dir
|
||||
from lib.models import default_voice_detection_model
|
||||
|
||||
warnings.filterwarnings("ignore", category=SyntaxWarning)
|
||||
|
||||
class BackgroundDetector:
|
||||
def __init__(self,wav_file:str):
|
||||
self.wav_file=wav_file
|
||||
|
||||
@@ -748,11 +748,6 @@ class DeviceInstaller():
|
||||
torch_pkg = f'{url}/{tag}/torch-{torch_version_base}%2B{tag}-{tag_py}-{os_env}_{arch}.whl'
|
||||
torchaudio_pkg = f'{url}/{tag}/torchaudio-{torch_version_base}%2B{tag}-{tag_py}-{os_env}_{arch}.whl'
|
||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', '--no-cache-dir', torch_pkg, torchaudio_pkg])
|
||||
#if device_info['name'] == 'cuda':
|
||||
# subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', '--no-cache-dir', '--no-build-isolation', 'deepspeed'])
|
||||
#msg = 'Relaunching app...'
|
||||
#print(msg)
|
||||
#os.execv(sys.executable, [sys.executable] + sys.argv)
|
||||
except subprocess.CalledProcessError as e:
|
||||
error = f'Failed to install torch package: {e}'
|
||||
print(error)
|
||||
|
||||
@@ -9,7 +9,7 @@ from __future__ import annotations
|
||||
|
||||
import argparse, asyncio, csv, fnmatch, hashlib, io, json, math, os, pytesseract, gc
|
||||
import platform, random, shutil, subprocess, sys, tempfile, threading, time, uvicorn
|
||||
import traceback, socket, warnings, unicodedata, urllib.request, uuid, zipfile, fitz
|
||||
import traceback, socket, unicodedata, urllib.request, uuid, zipfile, fitz
|
||||
import ebooklib, gradio as gr, psutil, regex as re, requests, stanza
|
||||
|
||||
from typing import Any
|
||||
@@ -55,8 +55,6 @@ from lib.classes.tts_manager import TTSManager
|
||||
# format="%(asctime)s [%(levelname)s] %(message)s"
|
||||
#)
|
||||
|
||||
warnings.filterwarnings("ignore", category=UserWarning, module="jieba._compat")
|
||||
|
||||
context = None
|
||||
context_tracker = None
|
||||
active_sessions = None
|
||||
|
||||
Reference in New Issue
Block a user