Update app.py
Browse files
app.py
CHANGED
|
@@ -131,11 +131,11 @@ if uploaded_file:
|
|
| 131 |
|
| 132 |
# 1. Diarization
|
| 133 |
try:
|
| 134 |
-
# Ultra-robust initialization for pyannote.audio to prevent Revision errors
|
| 135 |
model_id = "pyannote/speaker-diarization"
|
| 136 |
pipeline = None
|
| 137 |
|
| 138 |
-
# Attempt 1: Modern syntax (revision keyword)
|
| 139 |
try:
|
| 140 |
pipeline = Pipeline.from_pretrained(
|
| 141 |
model_id,
|
|
@@ -143,17 +143,17 @@ if uploaded_file:
|
|
| 143 |
token=ACTIVE_HF_TOKEN
|
| 144 |
)
|
| 145 |
except Exception:
|
| 146 |
-
# Attempt 2:
|
| 147 |
try:
|
| 148 |
pipeline = Pipeline.from_pretrained(
|
| 149 |
f"{model_id}@2.1",
|
| 150 |
use_auth_token=ACTIVE_HF_TOKEN
|
| 151 |
)
|
| 152 |
except Exception:
|
| 153 |
-
# Attempt 3: Basic string
|
| 154 |
pipeline = Pipeline.from_pretrained(
|
| 155 |
model_id,
|
| 156 |
-
|
| 157 |
)
|
| 158 |
|
| 159 |
if pipeline is None:
|
|
|
|
| 131 |
|
| 132 |
# 1. Diarization
|
| 133 |
try:
|
| 134 |
+
# Ultra-robust initialization for pyannote.audio to prevent Revision and Argument errors
|
| 135 |
model_id = "pyannote/speaker-diarization"
|
| 136 |
pipeline = None
|
| 137 |
|
| 138 |
+
# Attempt 1: Modern syntax (revision keyword + token keyword)
|
| 139 |
try:
|
| 140 |
pipeline = Pipeline.from_pretrained(
|
| 141 |
model_id,
|
|
|
|
| 143 |
token=ACTIVE_HF_TOKEN
|
| 144 |
)
|
| 145 |
except Exception:
|
| 146 |
+
# Attempt 2: Older syntax (use_auth_token)
|
| 147 |
try:
|
| 148 |
pipeline = Pipeline.from_pretrained(
|
| 149 |
f"{model_id}@2.1",
|
| 150 |
use_auth_token=ACTIVE_HF_TOKEN
|
| 151 |
)
|
| 152 |
except Exception:
|
| 153 |
+
# Attempt 3: Basic string with modern token keyword
|
| 154 |
pipeline = Pipeline.from_pretrained(
|
| 155 |
model_id,
|
| 156 |
+
token=ACTIVE_HF_TOKEN
|
| 157 |
)
|
| 158 |
|
| 159 |
if pipeline is None:
|