https://github.com/codelibs/sparse-encoding-api
https://github.com/codelibs/sparse-encoding-api
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codelibs/sparse-encoding-api
- Owner: codelibs
- Created: 2024-03-16T06:13:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-16T06:14:59.000Z (over 2 years ago)
- Last Synced: 2025-01-28T10:36:18.221Z (over 1 year ago)
- Language: Python
- Size: 43.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sparse Encoding Server
## Getting Started
### Run Docker
```
docker run -p 8080:8080 -it ghcr.io/codelibs/sparse-encoding-api:1.0.0
```
### Run Docker with Model Name
```
docker run -p 8080:8080 -e MODEL_NAME=naver/splade_v2_max -it ghcr.io/codelibs/sparse-encoding-api:1.0.0
```
### Use Model Cache
```
docker run -v ./model:/code/model -p 8080:8080 -it ghcr.io/codelibs/sparse-encoding-api:1.0.0
```
### Run Docker with GPU
```
docker run --gpus all -p 8080:8080 -it ghcr.io/codelibs/sparse-encoding-api:1.0.0.cuda11
```
## Request
### Embedding API
```
curl -s -H "Content-Type:application/json" -XPOST localhost:8080/encode -d '
{
"sentences": [
"This framework generates embeddings for each input sentence",
"Sentences are passed as a list of string.",
"The quick brown fox jumps over the lazy dog."
]
}'
```
### Information API
```
curl -s -H "Content-Type:application/json" -XGET localhost:8080/
```
### Ping API
```
curl -s -H "Content-Type:application/json" -XGET localhost:8080/ping
```
## Build
### Build Docker
```
docker build --rm -t ghcr.io/codelibs/sparse-encoding-api:1.0.0 .
```