Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/ModelCatalog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
return "Function calling";
}

if (property_id === "async_queue" && value === "true") {
return "Batch";
}

return [];
})
.filter((p) => Boolean(p)),
Expand All @@ -102,6 +106,10 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
return "Function calling";
}

if (property_id === "async_queue" && value === "true") {
return "Batch";
}

return [];
})
.filter((p) => Boolean(p)),
Expand Down
7 changes: 7 additions & 0 deletions src/components/models/ModelBadges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const ModelBadges = ({ model }: { model: WorkersAIModelsSchema }) => {
};
}

if (property_id === "async_queue" && value === "true") {
return {
variant: "note",
text: "Batch",
};
}

if (property_id === "planned_deprecation_date") {
const timestamp = Math.floor(new Date(value as string).getTime() / 1000);

Expand Down
6 changes: 6 additions & 0 deletions src/components/models/ModelFeatures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ const ModelFeatures = ({ model }: { model: WorkersAIModelsSchema }) => {
<td>Yes</td>
</tr>
)}
{properties.async_queue && (
<tr>
<td>Batch</td>
<td>Yes</td>
</tr>
)}
{properties.price && properties.price.length > 0 && (
<tr>
<td>Unit Pricing</td>
Expand Down
10 changes: 10 additions & 0 deletions src/content/workers-ai-models/bart-large-cnn.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
{
"property_id": "beta",
"value": "true"
},
{
"property_id": "price",
"value": [
{
"unit": "per M input tokens",
"price": 0,
"currency": "USD"
}
]
}
],
"schema": {
Expand Down
152 changes: 119 additions & 33 deletions src/content/workers-ai-models/bge-base-en-v1.5.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"created_at": "2023-09-25 19:21:11.898",
"tags": [],
"properties": [
{
"property_id": "async_queue",
"value": "true"
},
{
"property_id": "price",
"value": [
Expand All @@ -37,53 +41,135 @@
"schema": {
"input": {
"type": "object",
"properties": {
"text": {
"oneOf": [
{
"type": "string",
"description": "The text to embed",
"minLength": 1
"oneOf": [
{
"properties": {
"text": {
"oneOf": [
{
"type": "string",
"description": "The text to embed",
"minLength": 1
},
{
"type": "array",
"description": "Batch of text values to embed",
"items": {
"type": "string",
"description": "The text to embed",
"minLength": 1
},
"maxItems": 100
}
]
},
{
"pooling": {
"type": "string",
"enum": [
"mean",
"cls"
],
"default": "mean",
"description": "The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy."
}
},
"required": [
"text"
]
},
{
"properties": {
"requests": {
"type": "array",
"description": "Batch of text values to embed",
"description": "Batch of the embeddings requests to run using async-queue",
"items": {
"type": "string",
"description": "The text to embed",
"minLength": 1
},
"maxItems": 100
"properties": {
"text": {
"oneOf": [
{
"type": "string",
"description": "The text to embed",
"minLength": 1
},
{
"type": "array",
"description": "Batch of text values to embed",
"items": {
"type": "string",
"description": "The text to embed",
"minLength": 1
},
"maxItems": 100
}
]
},
"pooling": {
"type": "string",
"enum": [
"mean",
"cls"
],
"default": "mean",
"description": "The pooling method used in the embedding process. `cls` pooling will generate more accurate embeddings on larger inputs - however, embeddings created with cls pooling are not compatible with embeddings generated with mean pooling. The default pooling method is `mean` in order for this to not be a breaking change, but we highly suggest using the new `cls` pooling for better accuracy."
}
},
"required": [
"text"
]
}
}
},
"required": [
"requests"
]
}
},
"required": [
"text"
]
},
"output": {
"type": "object",
"contentType": "application/json",
"properties": {
"shape": {
"type": "array",
"items": {
"type": "number"
"oneOf": [
{
"type": "object",
"contentType": "application/json",
"properties": {
"shape": {
"type": "array",
"items": {
"type": "number"
}
},
"data": {
"type": "array",
"description": "Embeddings of the requested text values",
"items": {
"type": "array",
"description": "Floating point embedding representation shaped by the embedding model",
"items": {
"type": "number"
}
}
},
"pooling": {
"type": "string",
"enum": [
"mean",
"cls"
],
"description": "The pooling method used in the embedding process."
}
}
},
"data": {
"type": "array",
"description": "Embeddings of the requested text values",
"items": {
"type": "array",
"description": "Floating point embedding representation shaped by the embedding model",
"items": {
"type": "number"
{
"type": "object",
"contentType": "application/json",
"title": "Async response",
"properties": {
"request_id": {
"type": "string",
"description": "The async request id that can be used to obtain the results."
}
}
}
}
]
}
}
}
Loading
Loading