Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,16 +24,16 @@ def upload_files(creators_file, overnight_file, day_file, prime_file):
|
|
24 |
try:
|
25 |
# Save each file using its binary data
|
26 |
with open(os.path.join(UPLOAD_FOLDER, "creators_file.xlsx"), "wb") as f:
|
27 |
-
f.write(creators_file
|
28 |
|
29 |
with open(os.path.join(UPLOAD_FOLDER, "overnight_file.xlsx"), "wb") as f:
|
30 |
-
f.write(overnight_file
|
31 |
|
32 |
with open(os.path.join(UPLOAD_FOLDER, "day_file.xlsx"), "wb") as f:
|
33 |
-
f.write(day_file
|
34 |
|
35 |
with open(os.path.join(UPLOAD_FOLDER, "prime_file.xlsx"), "wb") as f:
|
36 |
-
f.write(prime_file
|
37 |
|
38 |
return "Files uploaded successfully!"
|
39 |
except Exception as e:
|
@@ -89,10 +89,10 @@ def app():
|
|
89 |
login_btn.click(login, inputs=[username, password], outputs=[login_status])
|
90 |
|
91 |
with gr.Tab("Upload Files"):
|
92 |
-
creators_file = gr.File(label="Creators File", type="
|
93 |
-
overnight_file = gr.File(label="Overnight File", type="
|
94 |
-
day_file = gr.File(label="Day File", type="
|
95 |
-
prime_file = gr.File(label="Prime File", type="
|
96 |
upload_btn = gr.Button("Upload Files")
|
97 |
upload_status = gr.Textbox(label="Upload Status", interactive=False)
|
98 |
|
@@ -121,3 +121,4 @@ def app():
|
|
121 |
if __name__ == "__main__":
|
122 |
app().launch()
|
123 |
|
|
|
|
24 |
try:
|
25 |
# Save each file using its binary data
|
26 |
with open(os.path.join(UPLOAD_FOLDER, "creators_file.xlsx"), "wb") as f:
|
27 |
+
f.write(creators_file)
|
28 |
|
29 |
with open(os.path.join(UPLOAD_FOLDER, "overnight_file.xlsx"), "wb") as f:
|
30 |
+
f.write(overnight_file)
|
31 |
|
32 |
with open(os.path.join(UPLOAD_FOLDER, "day_file.xlsx"), "wb") as f:
|
33 |
+
f.write(day_file)
|
34 |
|
35 |
with open(os.path.join(UPLOAD_FOLDER, "prime_file.xlsx"), "wb") as f:
|
36 |
+
f.write(prime_file)
|
37 |
|
38 |
return "Files uploaded successfully!"
|
39 |
except Exception as e:
|
|
|
89 |
login_btn.click(login, inputs=[username, password], outputs=[login_status])
|
90 |
|
91 |
with gr.Tab("Upload Files"):
|
92 |
+
creators_file = gr.File(label="Creators File", type="binary")
|
93 |
+
overnight_file = gr.File(label="Overnight File", type="binary")
|
94 |
+
day_file = gr.File(label="Day File", type="binary")
|
95 |
+
prime_file = gr.File(label="Prime File", type="binary")
|
96 |
upload_btn = gr.Button("Upload Files")
|
97 |
upload_status = gr.Textbox(label="Upload Status", interactive=False)
|
98 |
|
|
|
121 |
if __name__ == "__main__":
|
122 |
app().launch()
|
123 |
|
124 |
+
|