Skip to content

Commit

Permalink
chore: replace clip server address in docs (#857)
Browse files Browse the repository at this point in the history
* chore: replace clip server address in docs

* fix: address comments
  • Loading branch information
ZiniuYu committed Nov 11, 2022
1 parent 7108622 commit ebfa494
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions docs/user-guides/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ Then call `rank`, you can feed it with multiple Documents as a list:
```python
from clip_client import Client

c = Client(server='grpcs://demo-cas.jina.ai:2096')
c = Client(server='grpc://0.0.0.0:23456')
r = c.rank([d])

print(r['@m', ['text', 'scores__clip_score__value']])
Expand Down Expand Up @@ -571,7 +571,7 @@ To encode sentences:
---
emphasize-lines: 3
---
curl -X POST http://demo-cas.jina.ai:51000/post \
curl -X POST http://0.0.0.0:51000/post \
-H 'Content-Type: application/json' \
-d '{"data":[{"text": "First do it"}, {"text": "then do it right"}, {"text": "then do it better"}], "execEndpoint":"/"}'
```
Expand All @@ -582,7 +582,7 @@ To encode a local image, you need to load it as base64 string and put into the `
---
emphasize-lines: 3
---
curl -X POST http://demo-cas.jina.ai:51000/post \
curl -X POST http://0.0.0.0:51000/post \
-H 'Content-Type: application/json' \
-d '{"data":[{"text": "First do it"}, {"blob":"'"$( base64 test-1.jpeg)"'" }], "execEndpoint":"/"}'
```
Expand All @@ -593,7 +593,7 @@ To encode a remote image, you can simply put its address into `uri` field:
---
emphasize-lines: 3
---
curl -X POST http://demo-cas.jina.ai:51000/post \
curl -X POST http://0.0.0.0:51000/post \
-H 'Content-Type: application/json' \
-d '{"data":[{"text": "First do it"}, {"uri": "https://clip-as-service.jina.ai/_static/favicon.png"}], "execEndpoint":"/"}'
```
Expand All @@ -610,7 +610,7 @@ The embedding is inside `.data[].embedding`. If you have [jq](https://stedolan.g
---
emphasize-lines: 4
---
curl -X POST https://demo-cas.jina.ai:8443/post \
curl -X POST http://0.0.0.0:51000/post \
-H 'Content-Type: application/json' \
-d '{"data":[{"text": "hello, world!"}, {"blob":"'"$( base64 test-1.jpeg)"'" }], "execEndpoint":"/"}' | \
jq -c '.data[] | .embedding'
Expand Down
6 changes: 3 additions & 3 deletions docs/user-guides/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ with:
Here, `protocol` can be either `http` or `grpc`; `cert.pem` or `key.pem` represent both parts of a certificate, key being the private key to the certificate and crt being the signed certificate. You can run the following command in terminal:

```bash
openssl req -newkey rsa:4096 -nodes -sha512 -x509 -days 3650 -nodes -out cert.pem -keyout key.pem -subj "/CN=demo-cas.jina.ai"
openssl req -newkey rsa:4096 -nodes -sha512 -x509 -days 3650 -nodes -out cert.pem -keyout key.pem -subj "/CN=<your.clip.address>"
```

Note that if you are using `protocol: grpc` then `/CN=demo-cas.jina.ai` must strictly follow the IP address or the domain name of your server. Mismatch IP or domain name would throw an exception.
Note that if you are using `protocol: grpc` then `/CN=<your.clip.address>` must strictly follow the IP address or the domain name of your server. Mismatch IP or domain name would throw an exception.

Certificate and keys can be also generated via [letsencrypt.org](https://letsencrypt.org/), which is a free SSL provider.

Expand All @@ -559,7 +559,7 @@ When the server is successfully running, you can connect to it via client by set
```python
from clip_client import Client

c = Client('grpcs://demo-cas.jina.ai:2096')
c = Client('grpcs://<your.clip.address>:2096')

r = c.encode(
[
Expand Down

0 comments on commit ebfa494

Please sign in to comment.