Skip to content

Commit 4c338d4

Browse files
authored
feat: concatenate requester model name and model version (#10)
* feat: concatenate requester model version in python * fix: rename ranker text input key from 'passage' to 'text' * fix: rename ranker input key from 'passage' to 'text' in Go and JavaScript * fix: update model version handling in Go and JavaScript clients * feat: update stubs and tests * chore: update model repository paths
1 parent 5a3f796 commit 4c338d4

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can now import the Clinia Models client in your project and play with it.
3838

3939
### Embedder
4040

41-
``` typescript
41+
```typescript
4242
import { embedder } from '@clinia/models-client-embedder';
4343

4444
async function runEmbedderExample() {
@@ -52,7 +52,7 @@ async function runEmbedderExample() {
5252

5353
const result = await myEmbedder.embed(
5454
'embedder_medical_journals_qa',
55-
'120240905185426',
55+
'20250306T064951Z',
5656
{
5757
texts: ['Clinia is based in Montreal'],
5858
id: 'request-123',
@@ -66,6 +66,7 @@ runEmbedderExample().catch(console.error);
6666
```
6767

6868
### Chunker
69+
6970
```typescript
7071
import { chunker } from '@clinia/models-client-chunker';
7172

@@ -80,7 +81,7 @@ async function runChunkerExample() {
8081

8182
const result = await myChunker.chunk(
8283
'chunker',
83-
'120252801110000',
84+
'20250306T064951Z',
8485
{
8586
texts: ['Clinia is based in Montreal'],
8687
id: 'request-123',
@@ -94,7 +95,8 @@ runChunkerExample().catch(console.error);
9495
```
9596

9697
### Ranker
97-
``` typescript
98+
99+
```typescript
98100
import { ranker } from '@clinia/models-client-ranker';
99101

100102
async function runRankerExample() {
@@ -108,7 +110,7 @@ async function runRankerExample() {
108110

109111
const result = await myRanker.rank(
110112
'ranker_medical_journals_qa',
111-
'120240905185925',
113+
'20250306T064951Z',
112114
{
113115
query: 'hello, how are you?',
114116
texts: ['Clinia is based in Montreal'],

packages/models-client-ranker/src/ranker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const RANKER_QUERY_INPUT_KEY = 'query';
1010
const RANKER_QUERY_INPUT_DATATYPE: Datatype = 'BYTES';
1111

1212
// TODO: change to text
13-
const RANKER_TEXT_INPUT_KEY = 'passage';
13+
const RANKER_TEXT_INPUT_KEY = 'text';
1414
const RANKER_TEXT_INPUT_DATATYPE: Datatype = 'BYTES';
1515

1616
const RANKER_OUTPUT_KEY = 'score';
@@ -36,7 +36,7 @@ export type RankResponse = {
3636
*/
3737
id: string;
3838
/**
39-
* The list of scores for each pair of query and passage..
39+
* The list of scores for each pair of query and passage.
4040
*/
4141
scores: Float32Array;
4242
};
@@ -110,7 +110,7 @@ export class Ranker {
110110
for (const score of scores) {
111111
if (score.length !== 1) {
112112
throw new Error(
113-
`Expected a single score per passage, but got ${score.length} elements`,
113+
`Expected a single score per text, but got ${score.length} elements`,
114114
);
115115
}
116116
flattenedScores.push(...score);

packages/models-requester-grpc/src/requester.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ export class GrpcRequester implements Requester {
6565
}),
6666
);
6767

68+
// NOTE: The model version is always set to 1 because all models deployed within the same Triton server instance -- when stored in different model repositories -- must have unique names.
6869
return {
69-
modelName: modelName,
70-
modelVersion: modelVersion,
70+
modelName: `${modelName}:${modelVersion}`,
71+
modelVersion: '1',
7172
id: id,
7273
inputs: grpcInputs,
7374
outputs: grpcOutputs,

0 commit comments

Comments
 (0)