hanxiao commited on
Commit
a7478ad
·
verified ·
1 Parent(s): 7bd5405

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +18 -6
README.md CHANGED
@@ -55,10 +55,10 @@ curl -X POST "http://127.0.0.1:8080/v1/embeddings" \
55
  -H "Content-Type: application/json" \
56
  -d '{
57
  "input": [
58
- "A beautiful sunset over the beach",
59
- "Un beau coucher de soleil sur la plage",
60
- "海滩上美丽的日落",
61
- "浜辺に沈む美しい夕日"
62
  ]
63
  }'
64
  ```
@@ -72,12 +72,24 @@ curl -X POST "http://127.0.0.1:8080/v1/embeddings" \
72
  "input": [
73
  "Query: A beautiful sunset over the beach",
74
  "Query: Un beau coucher de soleil sur la plage",
75
- "Query: 海滩上美丽的日落",
76
- "Query: 浜辺に沈む美しい夕日"
77
  ]
78
  }'
79
  ```
80
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  You can also use `llama-embedding` for one-shot embedding:
82
 
83
  ```bash
 
55
  -H "Content-Type: application/json" \
56
  -d '{
57
  "input": [
58
+ "Query: A beautiful sunset over the beach",
59
+ "Query: Un beau coucher de soleil sur la plage",
60
+ "Query: 海滩上美丽的日落",
61
+ "Query: 浜辺に沈む美しい夕日"
62
  ]
63
  }'
64
  ```
 
72
  "input": [
73
  "Query: A beautiful sunset over the beach",
74
  "Query: Un beau coucher de soleil sur la plage",
75
+ "Passage: 海滩上美丽的日落",
76
+ "Passage: 浜辺に沈む美しい夕日"
77
  ]
78
  }'
79
  ```
80
 
81
+ To get fully consistent results as if you do AutoModel.from_pretrained("jinaai/jina-embeddings-v4")..., you need to be careful about the prefix and manually add them to your input to GGUF. Here's a reference table:
82
+
83
+ | Input Type | Task | `prompt_name` (Role) | Actual Input Processed by Model |
84
+ |------------|------|-------------|-------------------------------|
85
+ | **Text** | `retrieval` | `query` (default) | `Query: {original_text}` |
86
+ | **Text** | `retrieval` | `passage` | `Passage: {original_text}` |
87
+ | **Text** | `text-matching` | `query` (default) | `Query: {original_text}` |
88
+ | **Text** | `text-matching` | `passage` | `Query: {original_text}` ⚠️ |
89
+ | **Text** | `code` | `query` (default) | `Query: {original_text}` |
90
+ | **Text** | `code` | `passage` | `Passage: {original_text}` |
91
+ | **Image** | Any task | N/A | `<\|im_start\|>user\n<\|vision_start\|>\<\|image_pad\|>\<\|vision_end\|>Describe the image.\<\|im_end\|>` |
92
+
93
  You can also use `llama-embedding` for one-shot embedding:
94
 
95
  ```bash