Awlly commited on
Commit
4a76dec
·
1 Parent(s): 09e89d7

adjusted imput processing for rubert model

Browse files
Files changed (1) hide show
  1. app_models/rubert_MODEL.py +1 -1
app_models/rubert_MODEL.py CHANGED
@@ -17,7 +17,7 @@ logreg_model = joblib.load(logreg_model_path)
17
 
18
  def embed_bert_cls(text, model, tokenizer):
19
  """Generate embeddings for input text using the RuBERT model."""
20
- inputs = tokenizer(text, padding=True, truncation=True, max_length=512, return_tensors="pt")
21
  with torch.no_grad():
22
  outputs = model(**inputs)
23
  embeddings = outputs.last_hidden_state[:, 0, :]
 
17
 
18
  def embed_bert_cls(text, model, tokenizer):
19
  """Generate embeddings for input text using the RuBERT model."""
20
+ inputs = tokenizer(text, padding="max_length", truncation=True, max_length=128, return_tensors="pt")
21
  with torch.no_grad():
22
  outputs = model(**inputs)
23
  embeddings = outputs.last_hidden_state[:, 0, :]