mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
reduce mandatory requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
import html
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
import ftfy
|
||||
import regex as re
|
||||
import torch
|
||||
from transformers import AutoTokenizer, UMT5EncoderModel
|
||||
@@ -86,6 +85,9 @@ def optimized_scale(positive_flat, negative_flat):
|
||||
return st_star
|
||||
|
||||
def basic_clean(text):
|
||||
from installer import install
|
||||
install('ftfy')
|
||||
import ftfy
|
||||
text = ftfy.fix_text(text)
|
||||
text = html.unescape(html.unescape(text))
|
||||
return text.strip()
|
||||
|
||||
Reference in New Issue
Block a user