Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zhangyuan/text2vec-api


https://github.com/zhangyuan/text2vec-api

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# text2vec-api

A simple wrapper to text2vec to serve embedding as HTTP API.

## Setup

### Run with Docker

```bash
docker run -p 127.0.0.1:9008:8000 zhangyuan/text2vec-api
```

### Run with source code

Install the depedencies:

```bash
pip install -r requirements-mac.txt
# or

# pip install -r requirements.txt && pip install -r requirements-linux-torch
```

Launch the server:

```bash
make serve
```

## How to use the API

### Get request

Visit to get the embeddings.

### Post request

The server also supports `POST` request to `/embeddings` with request body like

```json
{
"input": "hello"
}
```