mirror of
https://github.com/dongdongunique/EvoSynth.git
synced 2026-07-16 17:17:37 +02:00
first commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# FILE: /jailbreak-toolbox/jailbreak-toolbox/jailbreak_toolbox/utils/__init__.py
|
||||
"""This file marks the utils directory as a Python package."""
|
||||
@@ -0,0 +1,12 @@
|
||||
def setup_logging(log_file='toolbox.log', level='DEBUG'):
|
||||
import logging
|
||||
|
||||
logging.basicConfig(
|
||||
filename=log_file,
|
||||
level=getattr(logging, level),
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
|
||||
def get_logger(name):
|
||||
import logging
|
||||
return logging.getLogger(name)
|
||||
@@ -0,0 +1,9 @@
|
||||
def tokenize(text):
|
||||
return text.split()
|
||||
|
||||
def normalize(text):
|
||||
return text.lower().strip()
|
||||
|
||||
def remove_punctuation(text):
|
||||
import string
|
||||
return text.translate(str.maketrans('', '', string.punctuation))
|
||||
Reference in New Issue
Block a user