mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
flagging dir uses function name
This commit is contained in:
parent
593af4ebf6
commit
05099e7cf6
@ -125,17 +125,14 @@ class Interface:
|
||||
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user