Spaces:
Sleeping
Sleeping
Create utils.py
Browse files
utils.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Small helper utilities in case you want to expand the Space
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def sanitize_prompt(text: str) -> str:
|
| 5 |
+
"""Basic sanitization: remove non-printable chars"""
|
| 6 |
+
return ''.join(ch for ch in text if ch.isprintable())
|