Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,11 @@ import threading
|
|
6 |
NUM_BACKEND_SERVERS = 3
|
7 |
|
8 |
# Initialize backend servers (pipelines) and availability flags
|
9 |
-
backend_servers = [
|
|
|
|
|
|
|
|
|
10 |
backend_locks = [threading.Lock() for _ in range(NUM_BACKEND_SERVERS)]
|
11 |
|
12 |
# Function to select a backend server (pipeline) based on availability
|
|
|
6 |
NUM_BACKEND_SERVERS = 3
|
7 |
|
8 |
# Initialize backend servers (pipelines) and availability flags
|
9 |
+
backend_servers = [
|
10 |
+
pipeline("question-answering", model="google-bert/bert-large-uncased-whole-word-masking-finetuned-squad"),
|
11 |
+
pipeline("question-answering", model="deepset/roberta-base-squad2"),
|
12 |
+
pipeline("question-answering", model="Intel/dynamic_tinybert")
|
13 |
+
] * (NUM_BACKEND_SERVERS // 3)
|
14 |
backend_locks = [threading.Lock() for _ in range(NUM_BACKEND_SERVERS)]
|
15 |
|
16 |
# Function to select a backend server (pipeline) based on availability
|