Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,3 +29,19 @@ if uploaded_file is not None:
|
|
| 29 |
st.write("Voice fine-tuning completed successfully!")
|
| 30 |
else:
|
| 31 |
st.write("Error in fine-tuning the voice.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
st.write("Voice fine-tuning completed successfully!")
|
| 30 |
else:
|
| 31 |
st.write("Error in fine-tuning the voice.")
|
| 32 |
+
|
| 33 |
+
# File uploader for subsequent requests
|
| 34 |
+
uploaded_file = st.file_uploader("Upload a text to clone your voice", type=["txt"])
|
| 35 |
+
|
| 36 |
+
if uploaded_file is not None:
|
| 37 |
+
# Simulate user requesting a new cloned voice (no need to upload their voice)
|
| 38 |
+
with open("user_text.txt", "w") as f:
|
| 39 |
+
f.write(uploaded_file.getvalue().decode("utf-8"))
|
| 40 |
+
|
| 41 |
+
# Call Google Colab model to generate cloned voice based on saved voice data
|
| 42 |
+
cloned_voice = requests.post("https://your-colab-backend-url", files={"file": open("user_text.txt", "rb")}).content
|
| 43 |
+
|
| 44 |
+
# Output the cloned voice
|
| 45 |
+
st.audio(cloned_voice, format="audio/wav")
|
| 46 |
+
st.write("Voice cloned successfully!")
|
| 47 |
+
|