-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebhook_start.py
45 lines (37 loc) · 936 Bytes
/
webhook_start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import requests
import json
url = "https://beam.slai.io/wz69m" # REPLACE WITH YOUR WEBHOOK URL
models = [
"nlpie/tiny-biobert",
"nlpie/tiny-clinicalbert",
"nlpie/clinical-mobilebert",
"nlpie/bio-mobilebert",
"mnaylor/psychbert-cased",
"mental/mental-bert-base-uncased",
"mental/mental-roberta-base",
"smallbenchnlp/roberta-small"
]
datasets = [
{
"dataset": "redditMH",
"label_count": 2,
"batch_size": 8,
}
]
for dataset in datasets:
for model in models:
payload = {
**dataset,
"model_name": model,
}
headers = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Authorization": "Basic YOUR_API_TOKEN", # REPLACE WITH YOUR BEAM API TOKEN
"Connection": "keep-alive",
"Content-Type": "application/json"
}
response = requests.request(
"POST", url, headers=headers, data=json.dumps(payload)
)
print(response.content)