Spaces:
Configuration error
Configuration error
Commit
·
fa91357
1
Parent(s):
3c4873d
Update app.py
Browse files
app.py
CHANGED
|
@@ -67,14 +67,14 @@ ckpt = st.file_uploader("Choose your CKPT", type= 'ckpt')
|
|
| 67 |
# Check if user uploaded a CKPT file
|
| 68 |
if ckpt is not None:
|
| 69 |
#TEMP FUNCTION
|
| 70 |
-
ckpt_temp_file = os.path.join(temp_dir.name, "ckpt_temp_file.ckpt")
|
| 71 |
with tempfile.NamedTemporaryFile(mode="wb", suffix='.ckpt', delete=False) as temp:
|
| 72 |
-
|
|
|
|
|
|
|
| 73 |
temp.write(bytes_data)
|
| 74 |
-
|
| 75 |
-
|
| 76 |
# Print the temporary file name
|
| 77 |
-
|
| 78 |
st.success("File saved to: {}".format(ckpt_temp_file))
|
| 79 |
|
| 80 |
# Display the file path
|
|
|
|
| 67 |
# Check if user uploaded a CKPT file
|
| 68 |
if ckpt is not None:
|
| 69 |
#TEMP FUNCTION
|
|
|
|
| 70 |
with tempfile.NamedTemporaryFile(mode="wb", suffix='.ckpt', delete=False) as temp:
|
| 71 |
+
# Get the file contents as bytes
|
| 72 |
+
bytes_data = config.getvalue()
|
| 73 |
+
# Write the bytes to the temporary file
|
| 74 |
temp.write(bytes_data)
|
| 75 |
+
config_temp_file = temp.name
|
|
|
|
| 76 |
# Print the temporary file name
|
| 77 |
+
print(temp.name)
|
| 78 |
st.success("File saved to: {}".format(ckpt_temp_file))
|
| 79 |
|
| 80 |
# Display the file path
|