Spaces:
Sleeping
Sleeping
Rewrite README with concise model and endpoint docs
Browse files
README.md
CHANGED
|
@@ -9,79 +9,60 @@ pinned: true
|
|
| 9 |
|
| 10 |
# Code-Embed-Qwen-rerank-sentiment
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
##
|
| 15 |
|
| 16 |
-
-
|
|
|
|
|
|
|
| 17 |
- Reranker: `Qwen/Qwen3-Reranker-0.6B`
|
|
|
|
| 18 |
- Classifier: `clapAI/modernBERT-base-multilingual-sentiment`
|
|
|
|
| 19 |
- Image embeddings: `sentence-transformers/clip-ViT-B-32`
|
|
|
|
|
|
|
| 20 |
|
| 21 |
## Endpoints
|
| 22 |
|
| 23 |
-
- `
|
| 24 |
-
- `
|
| 25 |
-
- `
|
| 26 |
-
- `
|
| 27 |
-
- `
|
| 28 |
-
- `
|
| 29 |
-
- `
|
| 30 |
|
| 31 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
##
|
| 34 |
|
| 35 |
```bash
|
| 36 |
-
curl -X POST "
|
| 37 |
-H "Content-Type: application/json" \
|
| 38 |
-
-d '{
|
| 39 |
-
"model": "code-embed",
|
| 40 |
-
"input": ["def quick_sort(arr): return sorted(arr)"]
|
| 41 |
-
}'
|
| 42 |
```
|
| 43 |
|
| 44 |
-
### Image Embeddings
|
| 45 |
-
|
| 46 |
```bash
|
| 47 |
-
curl -X POST "
|
| 48 |
-H "Content-Type: application/json" \
|
| 49 |
-
-d '{
|
| 50 |
-
"model": "clip-image",
|
| 51 |
-
"modality": "image",
|
| 52 |
-
"input": ["https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/coco_sample.png"]
|
| 53 |
-
}'
|
| 54 |
```
|
| 55 |
|
| 56 |
-
### Reranking
|
| 57 |
-
|
| 58 |
```bash
|
| 59 |
-
curl -X POST "
|
| 60 |
-H "Content-Type: application/json" \
|
| 61 |
-
-d '{
|
| 62 |
-
"model": "code-rerank",
|
| 63 |
-
"query": "python quick sort implementation",
|
| 64 |
-
"documents": [
|
| 65 |
-
"def quick_sort(arr): return sorted(arr)",
|
| 66 |
-
"SELECT * FROM users ORDER BY created_at DESC"
|
| 67 |
-
],
|
| 68 |
-
"return_documents": true
|
| 69 |
-
}'
|
| 70 |
```
|
| 71 |
|
| 72 |
-
### Classification
|
| 73 |
-
|
| 74 |
```bash
|
| 75 |
-
curl -X POST "
|
| 76 |
-H "Content-Type: application/json" \
|
| 77 |
-
-d '{
|
| 78 |
-
"model": "code-sentiment",
|
| 79 |
-
"input": ["The API is fast and easy to use."]
|
| 80 |
-
}'
|
| 81 |
```
|
| 82 |
-
|
| 83 |
-
## Notes
|
| 84 |
-
|
| 85 |
-
- The server lazy-loads one model family at a time to fit `cpu-basic` more safely.
|
| 86 |
-
- The first request after switching tasks will be slower because the model may need to be loaded.
|
| 87 |
-
- Jina embedding and reranking models are under `CC BY-NC 4.0`; verify that license for your use case.
|
|
|
|
| 9 |
|
| 10 |
# Code-Embed-Qwen-rerank-sentiment
|
| 11 |
|
| 12 |
+
Live API: `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space`
|
| 13 |
|
| 14 |
+
## Models
|
| 15 |
|
| 16 |
+
- Code embeddings: `jinaai/jina-code-embeddings-0.5b`
|
| 17 |
+
Served name: `code-embed`
|
| 18 |
+
Vector dimension: `896`
|
| 19 |
- Reranker: `Qwen/Qwen3-Reranker-0.6B`
|
| 20 |
+
Served name: `code-rerank`
|
| 21 |
- Classifier: `clapAI/modernBERT-base-multilingual-sentiment`
|
| 22 |
+
Served name: `code-sentiment`
|
| 23 |
- Image embeddings: `sentence-transformers/clip-ViT-B-32`
|
| 24 |
+
Served name: `clip-image`
|
| 25 |
+
Vector dimension: `512`
|
| 26 |
|
| 27 |
## Endpoints
|
| 28 |
|
| 29 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/health`
|
| 30 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/models`
|
| 31 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/embeddings`
|
| 32 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/embeddings_image`
|
| 33 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/rerank`
|
| 34 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/classify`
|
| 35 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/openapi.json`
|
| 36 |
|
| 37 |
+
## OpenAI-Style Aliases
|
| 38 |
+
|
| 39 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/v1/models`
|
| 40 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/v1/embeddings`
|
| 41 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/v1/rerank`
|
| 42 |
+
- `https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/v1/classify`
|
| 43 |
|
| 44 |
+
## Example Requests
|
| 45 |
|
| 46 |
```bash
|
| 47 |
+
curl -X POST "https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/embeddings" \
|
| 48 |
-H "Content-Type: application/json" \
|
| 49 |
+
-d '{"model":"code-embed","input":["def quick_sort(arr): return sorted(arr)"]}'
|
|
|
|
|
|
|
|
|
|
| 50 |
```
|
| 51 |
|
|
|
|
|
|
|
| 52 |
```bash
|
| 53 |
+
curl -X POST "https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/embeddings_image" \
|
| 54 |
-H "Content-Type: application/json" \
|
| 55 |
+
-d '{"model":"clip-image","input":["https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/coco_sample.png"]}'
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
```
|
| 57 |
|
|
|
|
|
|
|
| 58 |
```bash
|
| 59 |
+
curl -X POST "https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/rerank" \
|
| 60 |
-H "Content-Type: application/json" \
|
| 61 |
+
-d '{"model":"code-rerank","query":"python quick sort implementation","documents":["def quick_sort(arr): return sorted(arr)","SELECT * FROM users ORDER BY created_at DESC"],"return_documents":true}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
```
|
| 63 |
|
|
|
|
|
|
|
| 64 |
```bash
|
| 65 |
+
curl -X POST "https://chmielvu-code-embed-qwen-rerank-sentiment.hf.space/classify" \
|
| 66 |
-H "Content-Type: application/json" \
|
| 67 |
+
-d '{"model":"code-sentiment","input":["The API is fast and easy to use."]}'
|
|
|
|
|
|
|
|
|
|
| 68 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|