* update version
Browse files- app.py +3 -1
- output.py +12 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -127,7 +127,9 @@ except Exception as e:
|
|
127 |
|
128 |
# After:
|
129 |
if st_is_valid is not None:
|
130 |
-
st.subheader(
|
|
|
|
|
131 |
|
132 |
col1, col2 = st.columns(2)
|
133 |
|
|
|
127 |
|
128 |
# After:
|
129 |
if st_is_valid is not None:
|
130 |
+
st.subheader(
|
131 |
+
f"Results - {'valid' if st_is_valid else 'invalid'} ({round(st_time_delta.total_seconds())} seconds)"
|
132 |
+
)
|
133 |
|
134 |
col1, col2 = st.columns(2)
|
135 |
|
output.py
CHANGED
@@ -209,7 +209,15 @@ def init_settings() -> (List, Dict):
|
|
209 |
help="good: allow only good patterns, bad: ban bad patterns",
|
210 |
)
|
211 |
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
|
214 |
if "Relevance" in st_enabled_scanners:
|
215 |
st_rele_expander = st.sidebar.expander(
|
@@ -343,7 +351,9 @@ def get_scanner(scanner_name: str, vault: Vault, settings: Dict):
|
|
343 |
elif match_type == "bad":
|
344 |
bad_patterns = settings["patterns"]
|
345 |
|
346 |
-
return Regex(
|
|
|
|
|
347 |
|
348 |
if scanner_name == "Relevance":
|
349 |
return Relevance(threshold=settings["threshold"])
|
|
|
209 |
help="good: allow only good patterns, bad: ban bad patterns",
|
210 |
)
|
211 |
|
212 |
+
st_redact = st.checkbox(
|
213 |
+
"Redact", value=False, help="Replace the matched bad patterns with [REDACTED]"
|
214 |
+
)
|
215 |
+
|
216 |
+
settings["Regex"] = {
|
217 |
+
"patterns": st_regex_patterns,
|
218 |
+
"type": st_regex_type,
|
219 |
+
"redact": st_redact,
|
220 |
+
}
|
221 |
|
222 |
if "Relevance" in st_enabled_scanners:
|
223 |
st_rele_expander = st.sidebar.expander(
|
|
|
351 |
elif match_type == "bad":
|
352 |
bad_patterns = settings["patterns"]
|
353 |
|
354 |
+
return Regex(
|
355 |
+
good_patterns=good_patterns, bad_patterns=bad_patterns, redact=settings["redact"]
|
356 |
+
)
|
357 |
|
358 |
if scanner_name == "Relevance":
|
359 |
return Relevance(threshold=settings["threshold"])
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
llm-guard==0.2.
|
2 |
pandas==2.1.0
|
3 |
streamlit==1.26.0
|
4 |
streamlit-tags==1.2.8
|
|
|
1 |
+
llm-guard==0.2.1
|
2 |
pandas==2.1.0
|
3 |
streamlit==1.26.0
|
4 |
streamlit-tags==1.2.8
|