mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
Merge branch 'master' of https://github.com/gradio-app/gradio
This commit is contained in:
commit
ef9b5e228a
@ -684,7 +684,7 @@ class Interface:
|
||||
|
||||
if self.enable_queue is None:
|
||||
self.enable_queue = enable_queue
|
||||
if self.allow_flagging:
|
||||
if self.allow_flagging != "never":
|
||||
self.flagging_callback.setup(self.flagging_dir)
|
||||
|
||||
config = self.get_config_file()
|
||||
|
@ -67,5 +67,28 @@ class TestHuggingFaceDatasetSaver(unittest.TestCase):
|
||||
self.assertEqual(row_count, 2) # 3 rows written including header
|
||||
|
||||
|
||||
class TestDisableFlagging(unittest.TestCase):
|
||||
def test_flagging_no_permission_error_with_flagging_disabled(self):
|
||||
with tempfile.TemporaryDirectory() as tmpdirname:
|
||||
os.chmod(tmpdirname, 0o444) # Make directory read-only
|
||||
nonwritable_path = os.path.join(
|
||||
tmpdirname, 'flagging_dir')
|
||||
|
||||
io = gr.Interface(
|
||||
lambda x: x,
|
||||
"text",
|
||||
"text",
|
||||
allow_flagging="never",
|
||||
flagging_dir=nonwritable_path
|
||||
)
|
||||
try:
|
||||
io.launch(prevent_thread_lock=True)
|
||||
except PermissionError:
|
||||
self.fail("launch() raised a PermissionError unexpectedly")
|
||||
|
||||
io.close()
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
18
ui/packages/app/public/lang/de.json
Normal file
18
ui/packages/app/public/lang/de.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"interface": {
|
||||
"submit": "Absenden",
|
||||
"clear": "Löschen",
|
||||
"interpret": "Ersteller",
|
||||
"flag": "Flag",
|
||||
"examples": "Beispiele",
|
||||
"drop_image": "Bild hier ablegen",
|
||||
"drop_video": "Video hier ablegen",
|
||||
"drop_audio": "Audio hier ablegen",
|
||||
"drop_file": "Datei hier ablegen",
|
||||
"drop_csv": "CSV Datei hier ablegen",
|
||||
"or": "oder",
|
||||
"click_to_upload": "Hochladen",
|
||||
"view_api": "API anschauen",
|
||||
"built_with_Gradio": "Mit Gradio erstellt"
|
||||
}
|
||||
}
|
@ -5,14 +5,14 @@
|
||||
"interpret": "Interpretar",
|
||||
"flag": "Avisar",
|
||||
"examples": "Ejemplos",
|
||||
"drop_image": "Coloque la Imagen Aquí",
|
||||
"drop_video": "Coloque la Video Aquí",
|
||||
"drop_audio": "Coloque la Audio Aquí",
|
||||
"drop_file": "Coloque la Archivo Aquí",
|
||||
"drop_csv": "Coloque el CSV Aquí",
|
||||
"drop_image": "Coloque la imagen aquí",
|
||||
"drop_video": "Coloque el video aquí",
|
||||
"drop_audio": "Coloque el audio aquí",
|
||||
"drop_file": "Coloque el archivo aquí",
|
||||
"drop_csv": "Coloque el CSV aquí",
|
||||
"or": "o",
|
||||
"click_to_upload": "Haga Clic para Cargar",
|
||||
"view_api": "Para ver la API",
|
||||
"click_to_upload": "Haga click para cargar",
|
||||
"view_api": "Ver la API",
|
||||
"built_with_Gradio": "Construido con Gradio"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user