MCPcopy Create free account
hub / github.com/NineAbyss/ZeroG / text_emb

Method text_emb

code/dataset_benchmark.py:536–544  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

534 print("Label features added!")
535
536 def text_emb(self):
537 text_model = TextModel(self.args.text_encoder)
538 text_model = text_model.to(self.args.device)
539 raw_texts = self.data.raw_texts
540 text_features = []
541 for text in tqdm.tqdm(raw_texts, desc="Processing texts"):
542 text_features.append(text_model(text).unsqueeze(dim=0).cpu())
543 self.data.x = torch.cat(text_features, dim=0)
544 print("Text features added!")
545
546 @property
547 def raw_dir(self):

Callers 1

__init__Method · 0.95

Calls 1

TextModelClass · 0.90

Tested by

no test coverage detected