Skip to content

Commit

Permalink
flagging dir uses function name
Browse files Browse the repository at this point in the history
  • Loading branch information
aliabd committed Jul 28, 2020
1 parent 593af4e commit 05099e7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions gradio/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,14 @@ def get_output_instance(iface):

if self.allow_flagging:
if self.title is not None:
dir_name = "-".join(self.title.split(" ")) + "-1"
dir_name = "_".join(self.title.split(" ")) + "_1"
else:
dir_name = "-".join([inp.label for inp in
self.input_interfaces]) + "-to-" \
+ "-".join([out.label for out in
self.output_interfaces])\
+ "-1"
dir_name = "_".join([fn.__name__ for fn in self.predict]) + \
"_1"
i = 1
while os.path.exists(FLAGGING_DIRECTORY + dir_name):
i += 1
dir_name = dir_name[:-2] + "-" + str(i)
dir_name = dir_name[:-2] + "_" + str(i)
self.flagging_dir = FLAGGING_DIRECTORY + dir_name

try:
Expand Down

0 comments on commit 05099e7

Please sign in to comment.