Skip to content

Commit a71a338

Browse files
guiafonso-olLuizaVSantosguigoliverMarianaReisAlcantara
authored
[EDU-6507] Update AI models (#1663)
* fix: update models and code samples * feat: translate changes * Apply suggestions from code review Co-authored-by: LuizaVSantos <luiza.santos@azion.com> * Update src/content/docs/en/pages/main-menu/reference/edge-ai/ai-models/florence-2.mdx Co-authored-by: LuizaVSantos <luiza.santos@azion.com> * Update src/content/docs/en/pages/main-menu/reference/edge-ai/ai-models/florence-2.mdx Co-authored-by: LuizaVSantos <luiza.santos@azion.com> * fix: accept suggestions from code review * Update src/content/docs/en/pages/main-menu/reference/edge-ai/ai-models/qwen-2-5-vl-7b.mdx Co-authored-by: MarianaReisAlcantara <mariana.alcantara@azion.com> * Update src/content/docs/en/pages/main-menu/reference/edge-ai/ai-models/qwen-2-5-vl-7b.mdx Co-authored-by: MarianaReisAlcantara <mariana.alcantara@azion.com> * Update src/content/docs/pt-br/pages/menu-principal/referencia/edge-ai/ai-models/baai-bge-reranker-v2-m3.mdx Co-authored-by: MarianaReisAlcantara <mariana.alcantara@azion.com> * fix: accept suggestion fro code review * Update src/content/docs/pt-br/pages/menu-principal/referencia/edge-ai/ai-models/florence-2.mdx Co-authored-by: MarianaReisAlcantara <mariana.alcantara@azion.com> * Apply suggestions from code review Co-authored-by: MarianaReisAlcantara <mariana.alcantara@azion.com> * Apply suggestions from code review Co-authored-by: MarianaReisAlcantara <mariana.alcantara@azion.com> * fix: update wording * fix: adjust wording --------- Co-authored-by: LuizaVSantos <luiza.santos@azion.com> Co-authored-by: Guilherme Afonso <profguilherme.as@gmail.com> Co-authored-by: MarianaReisAlcantara <mariana.alcantara@azion.com>
1 parent f0e9139 commit a71a338

File tree

14 files changed

+2176
-624
lines changed

14 files changed

+2176
-624
lines changed

src/content/docs/en/pages/main-menu/reference/edge-ai/ai-models/baai-bge-reranker-v2-m3.mdx

Lines changed: 78 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ permalink: /documentation/products/ai/edge-ai/models/baai-bge-reranker-v2-m3/
2424

2525
| Feature | Details |
2626
|---------|--------|
27-
| Azion Long-term Support (LTS) | ✅ / |
28-
| Context Length | 8192 |
27+
| Azion Long-term Support (LTS) ||
28+
| Context Length | 8k tokens |
2929
| Supports LoRA ||
3030
| Input data | Text |
3131

@@ -35,50 +35,31 @@ permalink: /documentation/products/ai/edge-ai/models/baai-bge-reranker-v2-m3/
3535

3636
This is an example of a basic rerank request using this model:
3737

38-
```bash
39-
curl -X POST \
40-
http://endpoint-url/rerank \
41-
-H 'Content-Type: application/json' \
42-
-d '{
43-
"model": "BAAI/bge-reranker-v2-m3",
44-
"query": "What is deep learning?",
45-
"documents": [
46-
"Deep learning is a subset of machine learning that uses neural networks with many layers",
47-
"The weather is nice today",
48-
"Deep learning enables computers to learn from large amounts of data",
49-
"I like pizza"
50-
]
51-
}'
38+
```ts
39+
const modelResponse = await Azion.AI.run("baai-bge-reranker-v2-m3", {
40+
"query": "What is deep learning?",
41+
"documents": [
42+
"Deep learning is a subset of machine learning that uses neural networks with many layers",
43+
"The weather is nice today",
44+
"Deep learning enables computers to learn from large amounts of data",
45+
"I like pizza"
46+
]
47+
})
5248
```
5349

50+
| Property | Type | Description |
51+
|------------|------|-------------|
52+
| `query` | string | The search query or prompt to rank the documents against. |
53+
| `documents` | string[] | An array of documents to be ranked based on their relevance to the query. |
54+
5455
### Score example
5556

5657
This is an example of a basic score request using this model:
5758

58-
```bash
59-
curl -X POST \
60-
http://endpoint-url/score \
61-
-H 'Content-Type: application/json' \
62-
-d '{
63-
"model": "BAAI/bge-reranker-v2-m3",
64-
"text_1": "What is deep learning?",
65-
"text_2": [
66-
"Deep learning is a subset of machine learning that uses neural networks with many layers",
67-
"The weather is nice today",
68-
"Deep learning enables computers to learn from large amounts of data",
69-
"I like pizza"
70-
]
71-
}'
72-
```
73-
74-
### Running with Edge Functions:
75-
76-
This is an example of how to run this model using Edge Functions:
77-
7859
```ts
7960
const modelResponse = await Azion.AI.run("baai-bge-reranker-v2-m3", {
80-
"query": "What is deep learning?",
81-
"documents": [
61+
"text_1": "What is deep learning?",
62+
"text_2": [
8263
"Deep learning is a subset of machine learning that uses neural networks with many layers",
8364
"The weather is nice today",
8465
"Deep learning enables computers to learn from large amounts of data",
@@ -87,6 +68,65 @@ const modelResponse = await Azion.AI.run("baai-bge-reranker-v2-m3", {
8768
})
8869
```
8970

71+
| Property | Type | Description |
72+
|------------|------|-------------|
73+
| `text_1` | string | The first text input for the model to process. |
74+
| `text_2` | string[] | An array of text inputs for the model to process and give a score. |
75+
76+
Response example:
77+
78+
```json
79+
{
80+
"id": "rerank-356bf11f0e794f3c8f726bec7ba698bb",
81+
"model": "baai-bge-reranker-v2-m3",
82+
"usage": {
83+
"total_tokens": 78
84+
},
85+
"results": [
86+
{
87+
"index": 0,
88+
"document": {
89+
"text": "Deep learning is a subset of machine learning that uses neural networks with many layers"
90+
},
91+
"relevance_score": 0.99951171875
92+
},
93+
{
94+
"index": 2,
95+
"document": {
96+
"text": "Deep learning enables computers to learn from large amounts of data"
97+
},
98+
"relevance_score": 0.98291015625
99+
},
100+
{
101+
"index": 3,
102+
"document": {
103+
"text": "I like pizza"
104+
},
105+
"relevance_score": 0.00001621246337890625
106+
},
107+
{
108+
"index": 1,
109+
"document": {
110+
"text": "The weather is nice today"
111+
},
112+
"relevance_score": 0.000016033649444580078
113+
}
114+
]
115+
}
116+
```
117+
118+
| Property | Type | Description |
119+
| --------------------------- | ------ | ---------------------------------------------------------- |
120+
| `id` | string | Unique identifier for the rerank request. |
121+
| `model` | string | The name of the model used for reranking. |
122+
| `usage.total_tokens` | number | The total number of tokens used in the request. |
123+
| `results[]` | object[] | An array of reranked result objects. |
124+
| `results[].index` | number | The index of the document in the input list. |
125+
| `results[].document` | object | The document object containing the text. |
126+
| `results[].document.text` | string | The textual content of the document. |
127+
| `results[].relevance_score` | number | The relevance score assigned to the document by the model. |
128+
129+
90130
## JSON schema
91131

92132
```json

src/content/docs/en/pages/main-menu/reference/edge-ai/ai-models/e5-mistral-7b-instruct.mdx

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The **E5 Mistral 7B Instruct** model is optimized for English text embedding tas
2626
| Feature | Details |
2727
|---------|--------|
2828
| Azion Long-term Support (LTS) ||
29-
| Context Length | 32728 |
29+
| Context Length | 32k tokens |
3030
| Supports LoRA ||
3131
| Input Data | Text |
3232

@@ -36,27 +36,57 @@ The **E5 Mistral 7B Instruct** model is optimized for English text embedding tas
3636

3737
This is an example of how to use this model to generate embeddings for text input:
3838

39-
```bash
40-
curl http://endpoint-url/v1/embeddings \
41-
-H "Content-Type: application/json" \
42-
-d '{
43-
"input": "The food was delicious and the waiter...",
44-
"model": "intfloat/e5-mistral-7b-instruct",
45-
"encoding_format": "float"
46-
}'
47-
```
48-
49-
### Running with Edge Functions:
50-
51-
This is and example of how to use this model with Edge Functions:
52-
5339
```ts
5440
const modelResponse = await Azion.AI.run("intfloat-e5-mistral-7b-instruct", {
5541
"input": "The food was delicious and the waiter...",
5642
"encoding_format": "float"
5743
})
5844
```
5945

46+
| Property | Type | Description |
47+
|------------|------|-------------|
48+
| `input` | string | The text input for which embeddings are generated. |
49+
| `encoding_format` | string | The format of the embedding output. |
50+
51+
Response example:
52+
53+
```json
54+
{
55+
"id": "embd-84a83438abff420e9c785c1659ae8ad6",
56+
"object": "list",
57+
"created": 1746821207,
58+
"model": "intfloat-e5-mistral-7b-instruct",
59+
"data": [
60+
{
61+
"index": 0,
62+
"object": "embedding",
63+
"embedding": [0.01, ..., 0.005]
64+
}
65+
],
66+
"usage": {
67+
"prompt_tokens": 11,
68+
"total_tokens": 11,
69+
"completion_tokens": 0,
70+
"prompt_tokens_details": null
71+
}
72+
}
73+
```
74+
75+
| Property | Type | Description |
76+
| ----------------------------- | ---- | ---------------------------------------------------------------------- |
77+
| `id` | string | Unique identifier for the embedding request. |
78+
| `object` | string | The type of the returned object. |
79+
| `created` | number | Unix timestamp indicating when the request was created. |
80+
| `model` | string | The name of the model used for generating embeddings. |
81+
| `data` | array | An array of embedding result objects. |
82+
| `data[].index` | number | The index of the embedded item in the input. |
83+
| `data[].object` | string | The type of object in the data array. |
84+
| `data[].embedding` | array | The array of floating-point numbers representing the embedding vector. |
85+
| `usage.prompt_tokens` | number | Number of tokens in the input prompt. |
86+
| `usage.total_tokens` | number | Total tokens used in the request. |
87+
| `usage.completion_tokens` | number | Tokens used in the model’s output. |
88+
| `usage.prompt_tokens_details` | string | Additional token detail data. |
89+
6090
## JSON schema
6191

6292
```json

0 commit comments

Comments
 (0)