coeuslearning
commited on
Commit
•
71a7f7f
1
Parent(s):
4004279
Update app.py
Browse files
app.py
CHANGED
@@ -73,12 +73,12 @@ def generate(
|
|
73 |
# outputs.append(text)
|
74 |
# concatenated_outputs = " ".join(outputs)
|
75 |
# yield concatenated_outputs
|
76 |
-
concatenated_outputs = "
|
77 |
# yield concatenated_outputs
|
78 |
|
79 |
# Mask the output here
|
80 |
masked_output = mask_with_protecto(concatenated_outputs)
|
81 |
-
yield
|
82 |
|
83 |
|
84 |
def mask_with_protecto(text_for_prompt):
|
@@ -99,8 +99,7 @@ def mask_with_protecto(text_for_prompt):
|
|
99 |
# Parse the masked result from the API response and format it for display
|
100 |
masked_result = response.json()
|
101 |
masked_result_token_value = str(masked_result["data"][0]["token_value"])
|
102 |
-
|
103 |
-
return_value = str(masked_result_token_value)
|
104 |
return(return_value)
|
105 |
else:
|
106 |
# Return an error message if the API request was not successful.
|
|
|
73 |
# outputs.append(text)
|
74 |
# concatenated_outputs = " ".join(outputs)
|
75 |
# yield concatenated_outputs
|
76 |
+
concatenated_outputs = "".join([text for text in streamer])
|
77 |
# yield concatenated_outputs
|
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):
|
|
|
99 |
# Parse the masked result from the API response and format it for display
|
100 |
masked_result = response.json()
|
101 |
masked_result_token_value = str(masked_result["data"][0]["token_value"])
|
102 |
+
return_value = masked_result_token_value
|
|
|
103 |
return(return_value)
|
104 |
else:
|
105 |
# Return an error message if the API request was not successful.
|