huggingface / huggingface/setfit
set max_length in traner.train(), body max_seq_length Q
- Dominant language
- Jupyter Notebook
- Stars
- 2.8k
- Forks
- 267
- Avg merge
- 36m
- Merged PRs (30d)
- 5
Description
hello im junior developer in south korea, thx for great lib 👍
when i set max_length in trainer.train(max_length = 512),
Do you think I should do change setting in model_body[0].max_seq_length = 512 ?
OR Don't I have to it? just set train(max_length) ?
below my code.
thx a lot
```
model_id = "jhgan/ko-sroberta-multitask"
model = SetFitModel.from_pretrained(model_id)
model.model_body[0].max_seq_length = 512
model.to('cuda:1')
```
```
trainer = SetFitTrainer(
model=model,
train_dataset=dataset['train'],
eval_dataset=dataset['train'],
loss_class=CosineSimilarityLoss,
metric=compute_metrics,
batch_size=batch_size,
num_iterations=num_iterations,
num_epochs=num_epochs,
column_mapping={"text": "text", "voting": "label"},
use_amp = True
)
trainer.train(
max_length = 512
)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.