Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ import json
|
|
7 |
import time
|
8 |
|
9 |
API_URL = os.environ.get("API_URL")
|
10 |
-
|
11 |
supported_languages = ['zh', 'en']
|
12 |
|
13 |
output_dir = 'outputs'
|
@@ -105,10 +104,8 @@ def predict(prompt, style, audio_file_pth, agree):
|
|
105 |
start = time.time()
|
106 |
# Send the data as a POST request
|
107 |
response = requests.post(API_URL, json=data, timeout=60)
|
108 |
-
|
109 |
print(f'Get response successfully within {time.time() - start}')
|
110 |
|
111 |
-
|
112 |
# Check the response
|
113 |
if response.status_code == 200:
|
114 |
try:
|
@@ -135,7 +132,6 @@ def predict(prompt, style, audio_file_pth, agree):
|
|
135 |
None,
|
136 |
None,
|
137 |
)
|
138 |
-
|
139 |
text_hint += f'''Get response successfully \n'''
|
140 |
return (
|
141 |
text_hint,
|
@@ -152,26 +148,21 @@ We introduce OpenVoice, a versatile instant voice cloning approach that requires
|
|
152 |
|
153 |
markdown_table = """
|
154 |
<div align="center" style="margin-bottom: 10px;">
|
155 |
-
|
156 |
| | | |
|
157 |
| :-----------: | :-----------: | :-----------: |
|
158 |
| **OpenSource Repo** | **Project Page** | **Join the Community** |
|
159 |
| <div style='text-align: center;'><a style="display:inline-block,align:center" href='https://github.com/myshell-ai/OpenVoice'><img src='https://img.shields.io/github/stars/myshell-ai/OpenVoice?style=social' /></a></div> | [OpenVoice](https://research.myshell.ai/open-voice) | [![Discord](https://img.shields.io/discord/1122227993805336617?color=%239B59B6&label=%20Discord%20)](https://discord.gg/myshell) |
|
160 |
-
|
161 |
</div>
|
162 |
"""
|
163 |
|
164 |
markdown_table_v2 = """
|
165 |
<div align="center" style="margin-bottom: 2px;">
|
166 |
-
|
167 |
| | | | |
|
168 |
| :-----------: | :-----------: | :-----------: | :-----------: |
|
169 |
| **Github Repo** | <div style='text-align: center;'><a style="display:inline-block,align:center" href='https://github.com/myshell-ai/OpenVoice'><img src='https://img.shields.io/github/stars/myshell-ai/OpenVoice?style=social' /></a></div> | **Project Page** | [OpenVoice](https://research.myshell.ai/open-voice) |
|
170 |
-
|
171 |
| | |
|
172 |
| :-----------: | :-----------: |
|
173 |
**Join the Community** | [![Discord](https://img.shields.io/discord/1122227993805336617?color=%239B59B6&label=%20Discord%20)](https://discord.gg/myshell) |
|
174 |
-
|
175 |
</div>
|
176 |
"""
|
177 |
content = """
|
|
|
7 |
import time
|
8 |
|
9 |
API_URL = os.environ.get("API_URL")
|
|
|
10 |
supported_languages = ['zh', 'en']
|
11 |
|
12 |
output_dir = 'outputs'
|
|
|
104 |
start = time.time()
|
105 |
# Send the data as a POST request
|
106 |
response = requests.post(API_URL, json=data, timeout=60)
|
|
|
107 |
print(f'Get response successfully within {time.time() - start}')
|
108 |
|
|
|
109 |
# Check the response
|
110 |
if response.status_code == 200:
|
111 |
try:
|
|
|
132 |
None,
|
133 |
None,
|
134 |
)
|
|
|
135 |
text_hint += f'''Get response successfully \n'''
|
136 |
return (
|
137 |
text_hint,
|
|
|
148 |
|
149 |
markdown_table = """
|
150 |
<div align="center" style="margin-bottom: 10px;">
|
|
|
151 |
| | | |
|
152 |
| :-----------: | :-----------: | :-----------: |
|
153 |
| **OpenSource Repo** | **Project Page** | **Join the Community** |
|
154 |
| <div style='text-align: center;'><a style="display:inline-block,align:center" href='https://github.com/myshell-ai/OpenVoice'><img src='https://img.shields.io/github/stars/myshell-ai/OpenVoice?style=social' /></a></div> | [OpenVoice](https://research.myshell.ai/open-voice) | [![Discord](https://img.shields.io/discord/1122227993805336617?color=%239B59B6&label=%20Discord%20)](https://discord.gg/myshell) |
|
|
|
155 |
</div>
|
156 |
"""
|
157 |
|
158 |
markdown_table_v2 = """
|
159 |
<div align="center" style="margin-bottom: 2px;">
|
|
|
160 |
| | | | |
|
161 |
| :-----------: | :-----------: | :-----------: | :-----------: |
|
162 |
| **Github Repo** | <div style='text-align: center;'><a style="display:inline-block,align:center" href='https://github.com/myshell-ai/OpenVoice'><img src='https://img.shields.io/github/stars/myshell-ai/OpenVoice?style=social' /></a></div> | **Project Page** | [OpenVoice](https://research.myshell.ai/open-voice) |
|
|
|
163 |
| | |
|
164 |
| :-----------: | :-----------: |
|
165 |
**Join the Community** | [![Discord](https://img.shields.io/discord/1122227993805336617?color=%239B59B6&label=%20Discord%20)](https://discord.gg/myshell) |
|
|
|
166 |
</div>
|
167 |
"""
|
168 |
content = """
|