Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiniuYu committed Jun 13, 2023
1 parent 643aa78 commit 2b4eaaa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,10 @@ CLIP-as-service is a low-latency high-scalability service for embedding images a

## Try it!

An always-online server `api.clip.jina.ai` loaded with `ViT-L-14-336::openai` is there for you to play & test.
Before you start, make sure you have obtained a personal access token from the [Jina AI Cloud](https://cloud.jina.ai/settings/tokens),
or via CLI as described in [this guide](https://docs.jina.ai/jina-ai-cloud/login/#create-a-new-pat):

```bash
jina auth token create <name of PAT> -e <expiration days>
```

Then, you need to configure the access token in the parameter `credential` of the client in python or set it in the HTTP request header `Authorization` as `<your access token>`.

⚠️ Our demo server `demo-cas.jina.ai` is sunset and no longer available after **15th of Sept 2022**.

You can access to the hosted CLIP service at [Jina AI's Inference](https://cloud.jina.ai/user/inference) with free credits.
Inference provides a selection of AI models for common tasks, such as visual reasoning, question answering, or embedding modalities like texts and images.
All the available models are accessible via simple API calls - HTTPS or gRPC.
Read this [Inference Guide](https://clip-as-service.jina.ai/hosting/by-jina/) to learn more.

### Text & image embedding

Expand All @@ -63,7 +55,7 @@ Then, you need to configure the access token in the parameter `credential` of th

```bash
curl \
-X POST https://api.clip.jina.ai:8443/post \
-X POST https://<your-inference-address>-http.wolf.jina.ai/post \
-H 'Content-Type: application/json' \
-H 'Authorization: <your access token>' \
-d '{"data":[{"text": "First do it"},
Expand All @@ -81,7 +73,8 @@ curl \
from clip_client import Client

c = Client(
'grpcs://api.clip.jina.ai:2096', credential={'Authorization': '<your access token>'}
'grpcs://<your-inference-address>-grpc.wolf.jina.ai',
credential={'Authorization': '<your access token>'},
)

r = c.encode(
Expand Down Expand Up @@ -117,7 +110,7 @@ There are four basic visual reasoning skills: object recognition, object countin

```bash
curl \
-X POST https://api.clip.jina.ai:8443/post \
-X POST https://<your-inference-address>-http.wolf.jina.ai/post \
-H 'Content-Type: application/json' \
-H 'Authorization: <your access token>' \
-d '{"data":[{"uri": "https://picsum.photos/id/1/300/300",
Expand Down Expand Up @@ -146,7 +139,7 @@ gives:

```bash
curl \
-X POST https://api.clip.jina.ai:8443/post \
-X POST https://<your-inference-address>-http.wolf.jina.ai/post \
-H 'Content-Type: application/json' \
-H 'Authorization: <your access token>' \
-d '{"data":[{"uri": "https://picsum.photos/id/133/300/300",
Expand Down Expand Up @@ -183,7 +176,7 @@ gives:

```bash
curl \
-X POST https://api.clip.jina.ai:8443/post \
-X POST https://<your-inference-address>-http.wolf.jina.ai/post \
-H 'Content-Type: application/json' \
-H 'Authorization: <your access token>' \
-d '{"data":[{"uri": "https://picsum.photos/id/102/300/300",
Expand Down
17 changes: 6 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@

## Try it!

An always-online server `api.clip.jina.ai` loaded with `ViT-L-14-336::openai` is there for you to play & test.
Before you start, make sure you have obtained a personal access token from the [Jina AI Cloud](https://cloud.jina.ai/settings/tokens),
or via CLI as described in [this guide](https://docs.jina.ai/jina-ai-cloud/login/#create-a-new-pat):

```bash
jina auth token create <name of PAT> -e <expiration days>
```

Then, you need to configure the access token in the parameter `credential` of the client in python or set it in the HTTP request header `Authorization` as `<your access token>`.
You can access to the hosted CLIP service at [Jina AI's Inference](https://cloud.jina.ai/user/inference) with free credits.
Inference provides a selection of AI models for common tasks, such as visual reasoning, question answering, or embedding modalities like texts and images.
All the available models are accessible via simple API calls - HTTPS or gRPC.
Read this [Inference Guide](https://clip-as-service.jina.ai/hosting/by-jina/) to learn more.

````{tab} via gRPC ⚡⚡
Expand All @@ -35,7 +30,7 @@ emphasize-lines: 5
from clip_client import Client
c = Client(
'grpcs://api.clip.jina.ai:2096',
'grpcs://<your-inference-address>-grpc.wolf.jina.ai',
credential={'Authorization': '<your access token>'}
)
Expand All @@ -59,7 +54,7 @@ print(r)
emphasize-lines: 4
---
curl \
-X POST https://api.clip.jina.ai:8443/post \
-X POST https://<your-inference-address>-http.wolf.jina.ai/post \
-H 'Content-Type: application/json' \
-H 'Authorization: <your access token>' \
-d '{"data":[{"text": "First do it"},
Expand Down

0 comments on commit 2b4eaaa

Please sign in to comment.