Spaces:
Runtime error
Runtime error
Commit
·
0d70f50
1
Parent(s):
7ef7fa4
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,55 +6,12 @@ st.title('DIFF-SVC Render')
|
|
| 6 |
# File uploader
|
| 7 |
ckpt = st.file_uploader("Choose your CKPT", type= 'ckpt')
|
| 8 |
|
| 9 |
-
# Check if user uploaded a CKPT file
|
| 10 |
-
if ckpt is not None:
|
| 11 |
-
#TEMP FUNCTION
|
| 12 |
-
with tempfile.NamedTemporaryFile(mode="wb", suffix='.ckpt', delete=False) as temp:
|
| 13 |
-
# Get the file contents as bytes
|
| 14 |
-
bytes_data = ckpt.getvalue()
|
| 15 |
-
# Write the bytes to the temporary file
|
| 16 |
-
temp.write(bytes_data)
|
| 17 |
-
ckpt_temp_file = temp.name
|
| 18 |
-
# Print the temporary file name
|
| 19 |
-
print(temp.name)
|
| 20 |
-
|
| 21 |
-
# Display the file path
|
| 22 |
-
if "ckpt_temp_file" in locals():
|
| 23 |
-
st.success("File saved to: {}".format(ckpt_temp_file))
|
| 24 |
-
|
| 25 |
# File uploader
|
| 26 |
config = st.file_uploader("Choose your config", type= 'yaml')
|
| 27 |
|
| 28 |
-
# Check if user uploaded a config file
|
| 29 |
-
if config is not None:
|
| 30 |
-
#TEMP FUNCTION
|
| 31 |
-
with tempfile.NamedTemporaryFile(mode="wb", suffix='.yaml', delete=False) as temp:
|
| 32 |
-
# Get the file contents as bytes
|
| 33 |
-
bytes_data = config.getvalue()
|
| 34 |
-
# Write the bytes to the temporary file
|
| 35 |
-
temp.write(bytes_data)
|
| 36 |
-
config_temp_file = temp.name
|
| 37 |
-
# Print the temporary file name
|
| 38 |
-
print(temp.name)
|
| 39 |
-
|
| 40 |
-
# Display the file path
|
| 41 |
-
if "config_temp_file" in locals():
|
| 42 |
-
st.success("File saved to: {}".format(config_temp_file))
|
| 43 |
|
| 44 |
# File uploader
|
| 45 |
audio = st.file_uploader("Choose your audio", type=["wav", "mp3"])
|
| 46 |
|
| 47 |
-
# Check if user uploaded an audio file
|
| 48 |
-
if audio is not None:
|
| 49 |
-
#TEMP FUNCTION
|
| 50 |
-
with tempfile.NamedTemporaryFile(mode="wb", suffix='.wav', delete=False) as temp:
|
| 51 |
-
# Get the file contents as bytes
|
| 52 |
-
bytes_data = audio.getvalue()
|
| 53 |
-
# Write the bytes to the temporary file
|
| 54 |
-
temp.write(bytes_data)
|
| 55 |
-
audio_temp_file = temp.name
|
| 56 |
-
# Add a text input for the title with a default value of 0
|
| 57 |
-
title = st.text_input("Key", value="0")
|
| 58 |
-
# Add a button to start the rendering process
|
| 59 |
if st.button("Render audio"):
|
| 60 |
print("done")
|
|
|
|
| 6 |
# File uploader
|
| 7 |
ckpt = st.file_uploader("Choose your CKPT", type= 'ckpt')
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# File uploader
|
| 10 |
config = st.file_uploader("Choose your config", type= 'yaml')
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# File uploader
|
| 14 |
audio = st.file_uploader("Choose your audio", type=["wav", "mp3"])
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
if st.button("Render audio"):
|
| 17 |
print("done")
|