Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- netlify.toml +2 -0
- ui_frontend/script.js +4 -2
netlify.toml
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build]
|
| 2 |
+
publish = "ui_frontend"
|
ui_frontend/script.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
let currentMode = 'normal'; // 🎬 默认为普通模式
|
| 2 |
|
| 3 |
-
// ⚡ 核心修正:
|
| 4 |
-
const API_URL = "
|
|
|
|
|
|
|
| 5 |
|
| 6 |
function setMode(mode) {
|
| 7 |
currentMode = mode;
|
|
|
|
| 1 |
let currentMode = 'normal'; // 🎬 默认为普通模式
|
| 2 |
|
| 3 |
+
// ⚡ 核心修正:自动适配本地与生产 (Hugging Face) 环境
|
| 4 |
+
const API_URL = window.location.hostname === "127.0.0.1" || window.location.hostname === "localhost"
|
| 5 |
+
? "http://127.0.0.1:7860/theater"
|
| 6 |
+
: "https://jinv2-shensist-theater-matrix.hf.space/theater";
|
| 7 |
|
| 8 |
function setMode(mode) {
|
| 9 |
currentMode = mode;
|