can turn off flagging from interface

This commit is contained in:
aliabd 2020-07-27 14:21:26 -07:00
parent 7c7d2f6abf
commit c78126a55a
3 changed files with 8 additions and 2 deletions

View File

@ -41,7 +41,7 @@ class Interface:
live=False, show_input=True, show_output=True,
capture_session=False, title=None, description=None,
thumbnail=None, server_port=None, server_name=networking.LOCALHOST_NAME,
allow_screenshot=True):
allow_screenshot=True, allow_flagging=True):
"""
Parameters:
fn (Callable): the function to wrap an interface around.
@ -101,6 +101,7 @@ class Interface:
self.server_port = server_port
self.simple_server = None
self.allow_screenshot = allow_screenshot
self.allow_flagging = allow_flagging
Interface.instances.add(self)
data = {'fn': fn,

View File

@ -75,7 +75,9 @@ input.submit {
input.submit:hover {
background-color: #f39c12;
}
.flag {
visibility: hidden;
}
.flag.flagged {
background-color: pink;
}

View File

@ -128,6 +128,9 @@ function gradio(config, fn, target) {
if (config["allow_screenshot"]) {
target.find(".screenshot").css("visibility", "visible");
}
if(config["allow_flagging"]){
target.find(".flag").css("visibility", "visible");
}
target.find(".screenshot").click(function() {
$(".screenshot").hide();
$(".screenshot_logo").show();