Spaces:
Configuration error
Configuration error
Commit
·
7c9480b
1
Parent(s):
53e3158
Update app.py
Browse files
app.py
CHANGED
|
@@ -86,14 +86,11 @@ with tempfile.TemporaryDirectory(dir=os.path.expanduser("/~app")) as temp_dir:
|
|
| 86 |
# Check if user uploaded a config file
|
| 87 |
if config is not None:
|
| 88 |
#TEMP FUNCTION
|
| 89 |
-
with tempfile.NamedTemporaryFile(mode="
|
| 90 |
-
# Get the file contents as
|
| 91 |
-
|
| 92 |
-
# Write the
|
| 93 |
-
temp.write(
|
| 94 |
-
config_temp_file = temp.name
|
| 95 |
-
# Print the temporary file name
|
| 96 |
-
print(temp.name)
|
| 97 |
|
| 98 |
# Display the file path
|
| 99 |
if "config_temp_file" in locals():
|
|
|
|
| 86 |
# Check if user uploaded a config file
|
| 87 |
if config is not None:
|
| 88 |
#TEMP FUNCTION
|
| 89 |
+
with tempfile.NamedTemporaryFile(mode="w", suffix='.yaml', delete=False, dir=temp_dir) as temp:
|
| 90 |
+
# Get the file contents as a string
|
| 91 |
+
str_data = config.read()
|
| 92 |
+
# Write the string to the temporary file
|
| 93 |
+
temp.write(str_data)
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
# Display the file path
|
| 96 |
if "config_temp_file" in locals():
|