Spaces:
Running
Running
Update index.html
Browse files- index.html +3 -1
index.html
CHANGED
|
@@ -54,6 +54,7 @@
|
|
| 54 |
document.body.appendChild(renderer.domElement);
|
| 55 |
|
| 56 |
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
|
|
|
| 57 |
const controls = new THREE.OrbitControls(camera, renderer.domElement);
|
| 58 |
controls.enableDamping = true;
|
| 59 |
controls.dampingFactor = 0.05;
|
|
@@ -190,7 +191,8 @@
|
|
| 190 |
const socketStatus = document.getElementById('socket-status');
|
| 191 |
const statusText = document.getElementById('status');
|
| 192 |
// This automatically grabs the current Hugging Face URL and connects securely
|
| 193 |
-
const
|
|
|
|
| 194 |
|
| 195 |
ws.onopen = () => {
|
| 196 |
socketStatus.innerHTML = "🟢 Live TCP Connection";
|
|
|
|
| 54 |
document.body.appendChild(renderer.domElement);
|
| 55 |
|
| 56 |
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
| 57 |
+
camera.position.set(0, 1, 5);
|
| 58 |
const controls = new THREE.OrbitControls(camera, renderer.domElement);
|
| 59 |
controls.enableDamping = true;
|
| 60 |
controls.dampingFactor = 0.05;
|
|
|
|
| 191 |
const socketStatus = document.getElementById('socket-status');
|
| 192 |
const statusText = document.getElementById('status');
|
| 193 |
// This automatically grabs the current Hugging Face URL and connects securely
|
| 194 |
+
const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
| 195 |
+
const ws = new WebSocket(wsProtocol + window.location.host + '/api/generate_stream');
|
| 196 |
|
| 197 |
ws.onopen = () => {
|
| 198 |
socketStatus.innerHTML = "🟢 Live TCP Connection";
|