From 1dc464dcb0bad8a7221bd18198c8ff50bcb00b41 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 7 Apr 2023 14:42:03 -0300 Subject: [PATCH] Sort imports --- extensions/elevenlabs_tts/script.py | 3 ++- extensions/llama_prompts/script.py | 3 ++- extensions/sd_api_pictures/script.py | 4 ++-- extensions/silero_tts/script.py | 1 + extensions/silero_tts/test_tts.py | 1 - extensions/silero_tts/tts_preprocessor.py | 1 - modules/chat.py | 2 +- server.py | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/extensions/elevenlabs_tts/script.py b/extensions/elevenlabs_tts/script.py index 772952e1..5c727a30 100644 --- a/extensions/elevenlabs_tts/script.py +++ b/extensions/elevenlabs_tts/script.py @@ -2,10 +2,11 @@ import re from pathlib import Path import gradio as gr -import modules.shared as shared from elevenlabslib import ElevenLabsUser from elevenlabslib.helpers import save_bytes_to_path +import modules.shared as shared + params = { 'activate': True, 'api_key': '12345', diff --git a/extensions/llama_prompts/script.py b/extensions/llama_prompts/script.py index da2196ed..33650156 100644 --- a/extensions/llama_prompts/script.py +++ b/extensions/llama_prompts/script.py @@ -1,7 +1,8 @@ import gradio as gr -import modules.shared as shared import pandas as pd +import modules.shared as shared + df = pd.read_csv("https://raw.githubusercontent.com/devbrones/llama-prompts/main/prompts/prompts.csv") diff --git a/extensions/sd_api_pictures/script.py b/extensions/sd_api_pictures/script.py index 0c85c176..80a6027a 100644 --- a/extensions/sd_api_pictures/script.py +++ b/extensions/sd_api_pictures/script.py @@ -4,12 +4,12 @@ import re from pathlib import Path import gradio as gr -import modules.chat as chat -import modules.shared as shared import requests import torch from PIL import Image +from modules import chat, shared + torch._C._jit_set_profiling_mode(False) # parameters which can be customized in settings.json of webui diff --git a/extensions/silero_tts/script.py b/extensions/silero_tts/script.py index d601ff53..23f86e39 100644 --- a/extensions/silero_tts/script.py +++ b/extensions/silero_tts/script.py @@ -3,6 +3,7 @@ from pathlib import Path import gradio as gr import torch + from extensions.silero_tts import tts_preprocessor from modules import chat, shared from modules.html_generator import chat_html_wrapper diff --git a/extensions/silero_tts/test_tts.py b/extensions/silero_tts/test_tts.py index ad8ee764..ebc2c102 100644 --- a/extensions/silero_tts/test_tts.py +++ b/extensions/silero_tts/test_tts.py @@ -2,7 +2,6 @@ import time from pathlib import Path import torch - import tts_preprocessor torch._C._jit_set_profiling_mode(False) diff --git a/extensions/silero_tts/tts_preprocessor.py b/extensions/silero_tts/tts_preprocessor.py index 1dd751e4..da163230 100644 --- a/extensions/silero_tts/tts_preprocessor.py +++ b/extensions/silero_tts/tts_preprocessor.py @@ -2,7 +2,6 @@ import re from num2words import num2words - punctuation = r'[\s,.?!/)\'\]>]' alphabet_map = { "A": " Ei ", diff --git a/modules/chat.py b/modules/chat.py index 207009da..06bd8785 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -12,7 +12,7 @@ from PIL import Image import modules.extensions as extensions_module import modules.shared as shared from modules.extensions import apply_extensions -from modules.html_generator import (fix_newlines, chat_html_wrapper, +from modules.html_generator import (chat_html_wrapper, fix_newlines, make_thumbnail) from modules.text_generation import (encode, generate_reply, get_max_prompt_length) diff --git a/server.py b/server.py index c56ecacd..1f6a1f32 100644 --- a/server.py +++ b/server.py @@ -15,7 +15,7 @@ import gradio as gr from PIL import Image import modules.extensions as extensions_module -from modules import chat, shared, training, ui, api +from modules import api, chat, shared, training, ui from modules.html_generator import chat_html_wrapper from modules.LoRA import add_lora_to_model from modules.models import load_model, load_soft_prompt