Uan Sholanbayev
commited on
Commit
•
40f7dca
1
Parent(s):
582955e
added model
Browse files- __pycache__/handler.cpython-310.pyc +0 -0
- handler.py +1 -1
- main_test.py +2 -2
- model.ckpt +3 -0
__pycache__/handler.cpython-310.pyc
ADDED
Binary file (2.02 kB). View file
|
|
handler.py
CHANGED
@@ -36,5 +36,5 @@ class EndpointHandler():
|
|
36 |
diff = (np.array(texts_vec)[:, np.newaxis] - np.array(queries_vec))\
|
37 |
.reshape(-1, len(queries_vec[0]))
|
38 |
return [{
|
39 |
-
"outputs": self.model.predict_proba(diff)
|
40 |
}]
|
|
|
36 |
diff = (np.array(texts_vec)[:, np.newaxis] - np.array(queries_vec))\
|
37 |
.reshape(-1, len(queries_vec[0]))
|
38 |
return [{
|
39 |
+
"outputs": self.model.predict_proba(diff).tolist()
|
40 |
}]
|
main_test.py
CHANGED
@@ -42,10 +42,10 @@ semi_relevant_query = "Did Cristiano Ronaldo did a great work in Saudi league?"
|
|
42 |
|
43 |
|
44 |
# init handler
|
45 |
-
my_handler = EndpointHandler(path="
|
46 |
|
47 |
# prepare sample payload
|
48 |
-
relevant_payload = {"queries": [query], "texts": [summary]}
|
49 |
irrelevant_payload = {"queries": semi_relevant_query, "texts": [summary]}
|
50 |
|
51 |
# test the handler
|
|
|
42 |
|
43 |
|
44 |
# init handler
|
45 |
+
my_handler = EndpointHandler(path=".")
|
46 |
|
47 |
# prepare sample payload
|
48 |
+
relevant_payload = {"queries": [query], "texts": [summary] * 50}
|
49 |
irrelevant_payload = {"queries": semi_relevant_query, "texts": [summary]}
|
50 |
|
51 |
# test the handler
|
model.ckpt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:68d45e234eb4a928074dfd868cead0219ab85354cc53d20e772753c6bb9169d3
|
3 |
+
size 440449768
|