Spaces:
Running
Running
return json too
Browse files
app.py
CHANGED
@@ -911,8 +911,8 @@ def fetch_toxicity_level(self, msg, safer):
|
|
911 |
yjson = self._censor_me(msg,safer)
|
912 |
_canvas = self._draw_censor(yjson)
|
913 |
_yjson = json.dumps(yjson, indent=4)
|
914 |
-
|
915 |
-
return(_canvas)
|
916 |
# %%write -a app.py
|
917 |
# prompt: result from a lot of prompt AI and old fashion try and error
|
918 |
|
@@ -1035,7 +1035,8 @@ with gradio.Blocks() as gradio_app:
|
|
1035 |
in1.render()
|
1036 |
in2.render()
|
1037 |
but1.render()
|
1038 |
-
|
|
|
1039 |
|
1040 |
with gradio.Column(scale=2):
|
1041 |
out1.render()
|
|
|
911 |
yjson = self._censor_me(msg,safer)
|
912 |
_canvas = self._draw_censor(yjson)
|
913 |
_yjson = json.dumps(yjson, indent=4)
|
914 |
+
return (_canvas, _yjson)
|
915 |
+
#return(_canvas)
|
916 |
# %%write -a app.py
|
917 |
# prompt: result from a lot of prompt AI and old fashion try and error
|
918 |
|
|
|
1035 |
in1.render()
|
1036 |
in2.render()
|
1037 |
but1.render()
|
1038 |
+
out3.render()
|
1039 |
+
but1.click(monty.fetch_toxicity_level, inputs=[in1, in2], outputs=[out1,out3])
|
1040 |
|
1041 |
with gradio.Column(scale=2):
|
1042 |
out1.render()
|