Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,31 +1,13 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
from pyannote.core import Segment
|
| 5 |
-
import torch
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
def read_root():
|
| 11 |
-
auth_token = os.getenv('ID')
|
| 12 |
-
if auth_token is None:
|
| 13 |
-
return {"error": "ID environment variable not set"}
|
| 14 |
-
|
| 15 |
-
print(auth_token)
|
| 16 |
-
|
| 17 |
-
# Load the speaker diarization model using the token
|
| 18 |
-
pipeline = SpeakerDiarization.from_pretrained(
|
| 19 |
-
"pyannote/speaker-diarization",
|
| 20 |
-
use_auth_token="hf_" + auth_token
|
| 21 |
-
)
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
for turn, _, speaker in diarization.itertracks(yield_label=True):
|
| 28 |
-
print(f"Speaker {speaker}: {turn.start:.1f}s --> {turn.end:.1f}s")
|
| 29 |
-
|
| 30 |
-
return {"Hello": "World!"}
|
| 31 |
-
|
|
|
|
| 1 |
+
const express = require('express');
|
| 2 |
+
const path = require('path');
|
| 3 |
+
const app = express();
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
// Serve static files from the 'public' directory
|
| 6 |
+
app.use(express.static(path.join(__dirname, 'public')));
|
| 7 |
|
| 8 |
+
// ... your other routes and middleware ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
const port = 7860;
|
| 11 |
+
app.listen(port, () => {
|
| 12 |
+
console.log(`Server running on port ${port}`);
|
| 13 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|