MCPcopy Create free account
hub / github.com/BeastyZ/ConvSearch-R1 / __iter__

Method __iter__

index/dense/utils.py:123–135  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

121 self.num_replicas = -1
122
123 def __iter__(self):
124 if dist.is_initialized():
125 self.num_replicas = dist.get_world_size()
126 self.rank = dist.get_rank()
127 print("Rank:", self.rank, "world:", self.num_replicas)
128 else:
129 print("Not running in distributed mode")
130 for i, element in enumerate(self.elements):
131 if self.num_replicas != -1 and i % self.num_replicas != self.rank:
132 continue
133 records = self.fn(element, i)
134 for rec in records:
135 yield rec
136
137
138class EmbeddingCache:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected