Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
# -*- coding: UTF-8 -*-
|
| 3 |
'''
|
| 4 |
-
@Project :
|
| 5 |
-
@File :
|
| 6 |
@Author : zhongjian.wzj
|
| 7 |
@Date : 2025/4/7 19:55
|
| 8 |
Copyright (c) 2025, Alibaba Cloud. All rights reserved.
|
|
@@ -21,7 +21,6 @@ local_ip = requests.get('http://myip.ipip.net', timeout=5).text
|
|
| 21 |
print('local_ip: ', local_ip)
|
| 22 |
|
| 23 |
url = os.getenv('OMNITALKER_URL', "http://localhost:8012")
|
| 24 |
-
max_length = os.getenv('OMNITALKER_MAX_LENGTH', 10)
|
| 25 |
headers = {"Content-Type": "application/json"}
|
| 26 |
|
| 27 |
script_dir = Path(__file__).parent.absolute()
|
|
@@ -73,8 +72,8 @@ def predict(role, content, seed, speed):
|
|
| 73 |
if response.status_code == 200:
|
| 74 |
with gen_file_path.open(mode='wb') as vid:
|
| 75 |
vid.write(response.content)
|
| 76 |
-
else:
|
| 77 |
-
|
| 78 |
|
| 79 |
return gen_file_path
|
| 80 |
|
|
@@ -141,9 +140,11 @@ with open('style.css', 'r') as f:
|
|
| 141 |
with gr.Blocks(css=custom_css) as demo:
|
| 142 |
gr.Markdown("# <center> OmniTalker </center>")
|
| 143 |
|
|
|
|
|
|
|
| 144 |
gr.Markdown('''
|
| 145 |
### Steps:
|
| 146 |
-
1. Select a character in Examples. Waiting for `Reference Video` to load the video.
|
| 147 |
2. Enter text (Only **Chinese** and **English** are supported by far. Limit it to within **100** characters for performance.).
|
| 148 |
3. Generate. (Due to limitations in network speed and GPU resources, the generation speed may not achieve a real-time 1:1 ratio. Appreciate.)
|
| 149 |
|
|
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
# -*- coding: UTF-8 -*-
|
| 3 |
'''
|
| 4 |
+
@Project : OmniTalker
|
| 5 |
+
@File : app.py
|
| 6 |
@Author : zhongjian.wzj
|
| 7 |
@Date : 2025/4/7 19:55
|
| 8 |
Copyright (c) 2025, Alibaba Cloud. All rights reserved.
|
|
|
|
| 21 |
print('local_ip: ', local_ip)
|
| 22 |
|
| 23 |
url = os.getenv('OMNITALKER_URL', "http://localhost:8012")
|
|
|
|
| 24 |
headers = {"Content-Type": "application/json"}
|
| 25 |
|
| 26 |
script_dir = Path(__file__).parent.absolute()
|
|
|
|
| 72 |
if response.status_code == 200:
|
| 73 |
with gen_file_path.open(mode='wb') as vid:
|
| 74 |
vid.write(response.content)
|
| 75 |
+
# else:
|
| 76 |
+
# raise gr.Error(response.status_code)
|
| 77 |
|
| 78 |
return gen_file_path
|
| 79 |
|
|
|
|
| 140 |
with gr.Blocks(css=custom_css) as demo:
|
| 141 |
gr.Markdown("# <center> OmniTalker </center>")
|
| 142 |
|
| 143 |
+
gr.Markdown("### <center> 🏠 [project](https://humanaigc.github.io/omnitalker) 🚀[Paper](https://arxiv.org/abs/2504.02433v1) </center>")
|
| 144 |
+
|
| 145 |
gr.Markdown('''
|
| 146 |
### Steps:
|
| 147 |
+
1. Select a character in Examples. **Waiting for `Reference Video` to load the video**. (Custom upload of reference videos is currently under development and is not supported at this time.)
|
| 148 |
2. Enter text (Only **Chinese** and **English** are supported by far. Limit it to within **100** characters for performance.).
|
| 149 |
3. Generate. (Due to limitations in network speed and GPU resources, the generation speed may not achieve a real-time 1:1 ratio. Appreciate.)
|
| 150 |
|