coeuslearning
commited on
Commit
•
f97d79d
1
Parent(s):
8be8efe
Update app.py
Browse files
app.py
CHANGED
@@ -78,8 +78,18 @@ def generate(
|
|
78 |
|
79 |
# Mask the output here
|
80 |
masked_output = mask_with_protecto(concatenated_outputs)
|
|
|
81 |
yield masked_output
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
def mask_with_protecto(text_for_prompt):
|
85 |
mask_request_url = "https://trial.protecto.ai/api/vault/mask"
|
|
|
78 |
|
79 |
# Mask the output here
|
80 |
masked_output = mask_with_protecto(concatenated_outputs)
|
81 |
+
masked_output = format_for_html(masked_output)
|
82 |
yield masked_output
|
83 |
|
84 |
+
|
85 |
+
def format_for_html(text):
|
86 |
+
text = text.replace(" ", " ")
|
87 |
+
text = text.replace("\n", "")
|
88 |
+
return text
|
89 |
+
|
90 |
+
# Using the function
|
91 |
+
api_output = "N7JI9bzqbf M1L4LPGkyj is the CEO of Apple Inc."
|
92 |
+
formatted_output = format_for_html(api_output)
|
93 |
|
94 |
def mask_with_protecto(text_for_prompt):
|
95 |
mask_request_url = "https://trial.protecto.ai/api/vault/mask"
|