Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Fix syntax error in app.py - clean up import statements and code structure
Browse files
app.py
CHANGED
|
@@ -4,17 +4,7 @@ import gradio as gr
|
|
| 4 |
from config import SCENE_CONFIGS, MODEL_CHOICES, MODE_CHOICES, EPISODE_CONFIGS
|
| 5 |
from backend_api import submit_to_backend, get_task_status, get_task_result
|
| 6 |
from logging_utils import log_access, log_submission, is_request_allowed
|
| 7 |
-
from simulation import stream_simulation_results, convert_to_h264,
|
| 8 |
-
# 在启动时显示版本信息
|
| 9 |
-
display_version_info()
|
| 10 |
-
|
| 11 |
-
demo.launch(
|
| 12 |
-
server_name="0.0.0.0",
|
| 13 |
-
server_port=7860, # Hugging Face Space默认端口
|
| 14 |
-
share=False,
|
| 15 |
-
debug=False, # 生产环境建议关闭debug
|
| 16 |
-
allowed_paths=["./assets", "./logs", "./tmp"] # 添加临时目录到允许路径
|
| 17 |
-
)inal_video_from_oss_images
|
| 18 |
from ui_components import update_history_display, update_scene_display, update_episode_display, update_log_display, get_scene_instruction
|
| 19 |
from oss_utils import download_oss_file, get_user_tmp_dir, cleanup_user_tmp_dir, oss_file_exists, clean_oss_result_path
|
| 20 |
import os
|
|
@@ -363,10 +353,13 @@ with gr.Blocks(title="InternNav Model Inference Demo", css=custom_css) as demo:
|
|
| 363 |
demo.unload(fn=cleanup_session)
|
| 364 |
|
| 365 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
| 366 |
demo.launch(
|
| 367 |
server_name="0.0.0.0",
|
| 368 |
server_port=7860, # Hugging Face Space默认端口
|
| 369 |
-
share=
|
| 370 |
debug=False, # 生产环境建议关闭debug
|
| 371 |
allowed_paths=["./assets", "./logs", "./tmp"] # 添加临时目录到允许路径
|
| 372 |
)
|
|
|
|
| 4 |
from config import SCENE_CONFIGS, MODEL_CHOICES, MODE_CHOICES, EPISODE_CONFIGS
|
| 5 |
from backend_api import submit_to_backend, get_task_status, get_task_result
|
| 6 |
from logging_utils import log_access, log_submission, is_request_allowed
|
| 7 |
+
from simulation import stream_simulation_results, convert_to_h264, create_final_video_from_oss_images
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
from ui_components import update_history_display, update_scene_display, update_episode_display, update_log_display, get_scene_instruction
|
| 9 |
from oss_utils import download_oss_file, get_user_tmp_dir, cleanup_user_tmp_dir, oss_file_exists, clean_oss_result_path
|
| 10 |
import os
|
|
|
|
| 353 |
demo.unload(fn=cleanup_session)
|
| 354 |
|
| 355 |
if __name__ == "__main__":
|
| 356 |
+
# 在启动时显示版本信息
|
| 357 |
+
display_version_info()
|
| 358 |
+
|
| 359 |
demo.launch(
|
| 360 |
server_name="0.0.0.0",
|
| 361 |
server_port=7860, # Hugging Face Space默认端口
|
| 362 |
+
share=False,
|
| 363 |
debug=False, # 生产环境建议关闭debug
|
| 364 |
allowed_paths=["./assets", "./logs", "./tmp"] # 添加临时目录到允许路径
|
| 365 |
)
|