AstraOS commited on
Commit
4e076ab
·
verified ·
1 Parent(s): 438b1f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -36,7 +36,7 @@ for directory in ["/home/user/app", "/data"]:
36
 
37
 
38
 
39
- fileManager = FileManager()
40
  fileManager.start()
41
 
42
 
@@ -53,4 +53,17 @@ with gr.Blocks() as demo:
53
  gr.FileExplorer(label="Working directory")
54
  gr.FileExplorer(root="/home/user/app", label="Persistent storage")
55
 
56
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
 
38
 
39
+ """fileManager = FileManager()
40
  fileManager.start()
41
 
42
 
 
53
  gr.FileExplorer(label="Working directory")
54
  gr.FileExplorer(root="/home/user/app", label="Persistent storage")
55
 
56
+ demo.launch()"""
57
+
58
+ with gr.Blocks() as demo:
59
+ # File explorer for working directory
60
+ working_dir = gr.FileExplorer(label="Working directory")
61
+
62
+ # File explorer with persistent storage (optional)
63
+ persistent_storage = gr.FileExplorer(root="/home/user/app", label="Persistent storage")
64
+
65
+ # Connect file explorer output to saveFile function input
66
+ demo.launch(fn=saveFile, inputs=working_dir.outputs, outputs="text")
67
+
68
+ # Optionally, if you want to use persistent storage:
69
+ # demo.launch(fn=saveFile, inputs=[working_dir.outputs, persistent_storage.outputs], outputs="text")