Skip to content

Commit c202507

Browse files
feat: support camembert (#42)
1 parent d123a5a commit c202507

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ such as:
5353

5454
### Supported Models
5555

56-
You can use any BERT or XLM-RoBERTa model with absolute positions in `text-embeddings-inference`.
56+
You can use any BERT, CamemBERT or XLM-RoBERTa model with absolute positions in `text-embeddings-inference`.
5757

5858
**Support for other model types will be added in the future.**
5959

backends/candle/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ impl CandleBackend {
3434
// Check model type
3535
if config.model_type != Some("bert".to_string())
3636
&& config.model_type != Some("xlm-roberta".to_string())
37+
&& config.model_type != Some("camembert".to_string())
3738
{
3839
return Err(BackendError::Start(format!(
3940
"Model {:?} is not supported",

router/src/main.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,13 @@ async fn main() -> Result<()> {
214214
);
215215
tokenizer.with_padding(None);
216216

217-
// Position IDs offset. Used for Roberta.
218-
let position_offset = if &config.model_type == "xlm-roberta" {
219-
config.pad_token_id + 1
220-
} else {
221-
0
222-
};
217+
// Position IDs offset. Used for Roberta and camembert.
218+
let position_offset =
219+
if &config.model_type == "xlm-roberta" || &config.model_type == "camembert" {
220+
config.pad_token_id + 1
221+
} else {
222+
0
223+
};
223224
let max_input_length = config.max_position_embeddings - position_offset;
224225

225226
let tokenization_workers = args

0 commit comments

Comments
 (0)