chore: using a database for keys
Browse files- handler.py +7 -0
handler.py
CHANGED
@@ -45,6 +45,9 @@ class EndpointHandler:
|
|
45 |
while uid in self.key_database.keys():
|
46 |
uid = np.random.randint(2**32)
|
47 |
|
|
|
|
|
|
|
48 |
self.key_database[uid] = evaluation_keys
|
49 |
|
50 |
return {"uid": uid}
|
@@ -52,6 +55,10 @@ class EndpointHandler:
|
|
52 |
elif method == "inference":
|
53 |
|
54 |
uid = data.pop("uid", data)
|
|
|
|
|
|
|
|
|
55 |
assert uid in self.key_database.keys(), f"{uid} not in DB"
|
56 |
|
57 |
# Get inputs
|
|
|
45 |
while uid in self.key_database.keys():
|
46 |
uid = np.random.randint(2**32)
|
47 |
|
48 |
+
# BCM
|
49 |
+
uid = 42
|
50 |
+
|
51 |
self.key_database[uid] = evaluation_keys
|
52 |
|
53 |
return {"uid": uid}
|
|
|
55 |
elif method == "inference":
|
56 |
|
57 |
uid = data.pop("uid", data)
|
58 |
+
|
59 |
+
# BCM
|
60 |
+
uid = 42
|
61 |
+
|
62 |
assert uid in self.key_database.keys(), f"{uid} not in DB"
|
63 |
|
64 |
# Get inputs
|