mirror of
https://github.com/SillyTavern/SillyTavern-Extras.git
synced 2026-03-10 05:50:10 +00:00
start update classify module
This commit is contained in:
24
server.py
24
server.py
@@ -221,16 +221,6 @@ if "summarize" in modules:
|
||||
summarization_model, torch_dtype=torch_dtype
|
||||
).to(device)
|
||||
|
||||
if "classify" in modules:
|
||||
print("Initializing a sentiment classification pipeline...")
|
||||
classification_pipe = pipeline(
|
||||
"text-classification",
|
||||
model=classification_model,
|
||||
top_k=None,
|
||||
device=device,
|
||||
torch_dtype=torch_dtype,
|
||||
)
|
||||
|
||||
if "sd" in modules and not sd_use_remote:
|
||||
from diffusers import StableDiffusionPipeline
|
||||
from diffusers import EulerAncestralDiscreteScheduler
|
||||
@@ -337,6 +327,20 @@ if max_content_length is not None:
|
||||
print("Setting MAX_CONTENT_LENGTH to",max_content_length,"Mb")
|
||||
app.config["MAX_CONTENT_LENGTH"] = int(max_content_length) * 1024 * 1024
|
||||
|
||||
# TODO: Keij, unify main classify and module one
|
||||
if "classify" in modules:
|
||||
print("Initializing a sentiment classification pipeline...")
|
||||
classification_pipe = pipeline(
|
||||
"text-classification",
|
||||
model=classification_model,
|
||||
top_k=None,
|
||||
device=device,
|
||||
torch_dtype=torch_dtype,
|
||||
)
|
||||
|
||||
import modules.classify.classify_module as classify_module
|
||||
classify_module.init_text_emotion_classifier(classification_model)
|
||||
|
||||
if "vosk-stt" in modules:
|
||||
print("Initializing Vosk speech-recognition (from ST request file)")
|
||||
vosk_model_path = (
|
||||
|
||||
Reference in New Issue
Block a user