File size: 970 Bytes
d8760c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Python

## Setup

Install dependencies

```
python3 -m venv env
source env/bin/activate
pip install  -r py/requirements.txt
```

Download a copy of model weights

```
curl https://storage.googleapis.com/uncertainty-over-space/zari-bert-cda/pytorch_model.bin -o zari-bert-cda/pytorch_model.bin

curl https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/pytorch_model.bin -0 bert-large-uncased-whole-word-masking/pytorch_model.bin
```

Start server

```
source env/bin/activate
cd py && python main.py
```

## Deploy

The `py` folder is bundled with docker and deployed to [Cloud Run](https://cloud.google.com/run/docs/quickstarts/build-and-deploy/python).

```
cd py

gcloud builds submit --tag gcr.io/uncertainty-over-space/helloworld --project=uncertainty-over-space && gcloud run deploy --image gcr.io/uncertainty-over-space/helloworld --project=uncertainty-over-space
```

https://huggingface.co/blog/how-to-deploy-a-pipeline-to-google-clouds