Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Reset HFTrainer #879

davidmezzettif880793ae3ff
diff --git a/src/python/txtai/pipeline/train/hftrainer.py b/src/python/txtai/pipeline/train/hftrainer.py
index 9d493a9d..ef04431d 100644
--- a/src/python/txtai/pipeline/train/hftrainer.py
+++ b/src/python/txtai/pipeline/train/hftrainer.py
@@ -89,8 +89,8 @@ class HFTrainer(Tensors):
# Parse TrainingArguments
args = self.parse(args)
- # Initialize torch parameters for reproducibility
- self.initialize(args.seed)
+ # Set seed for model reproducibility
+ set_seed(args.seed)
# Load model configuration, tokenizer and max sequence length
config, tokenizer, maxlength = self.load(base, maxlength)
@@ -162,21 +162,6 @@ class HFTrainer(Tensors):
return TrainingArguments(**args)
- def initialize(self, seed):
- """
- Initializes torch parameters to ensure reproducibility.
-
- Args:
- seed: seed to set
- """
-
- # Set seed for model reproducibility
- set_seed(seed)
-
- # Enable cuDNN deterministic mode
- torch.backends.cudnn.deterministic = True
- torch.backends.cudnn.benchmark = False
-
def load(self, base, maxlength):
"""
Loads the base config and tokenizer.