Spaces:
Paused
Paused
Update utils.py
Browse files
utils.py
CHANGED
@@ -3,30 +3,13 @@ import numpy as np
|
|
3 |
import httpx
|
4 |
import os
|
5 |
|
6 |
-
from constants import MUBERT_TAGS, MUBERT_MODE, MUBERT_LICENSE
|
7 |
|
8 |
def get_mubert_tags_embeddings(w2v_model):
|
9 |
return w2v_model.encode(MUBERT_TAGS)
|
10 |
|
11 |
|
12 |
-
|
13 |
-
r = httpx.post('https://api-b2b.mubert.com/v2/GetServiceAccess',
|
14 |
-
json={
|
15 |
-
"method": "GetServiceAccess",
|
16 |
-
"params": {
|
17 |
-
"email":"[email protected]",
|
18 |
-
"phone":"+11234567890",
|
19 |
-
"license": MUBERT_LICENSE,
|
20 |
-
"token": MUBERT_TOKEN,
|
21 |
-
"mode": MUBERT_MODE,
|
22 |
-
}
|
23 |
-
})
|
24 |
-
|
25 |
-
rdata = json.loads(r.text)
|
26 |
-
print(rdata)
|
27 |
-
#assert rdata['status'] == 1, "probably incorrect e-mail"
|
28 |
-
pat = rdata['data']['pat']
|
29 |
-
return pat
|
30 |
|
31 |
|
32 |
def find_similar(em, embeddings, method='cosine'):
|
|
|
3 |
import httpx
|
4 |
import os
|
5 |
|
6 |
+
from constants import MUBERT_TAGS, MUBERT_MODE, MUBERT_LICENSE
|
7 |
|
8 |
def get_mubert_tags_embeddings(w2v_model):
|
9 |
return w2v_model.encode(MUBERT_TAGS)
|
10 |
|
11 |
|
12 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
|
15 |
def find_similar(em, embeddings, method='cosine'):
|