Skip to content

Commit

Permalink
training protocol fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayBlagoev committed Mar 6, 2024
1 parent 7e6c696 commit 997b49b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions trainingprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ async def start(self):
await super().start()
if self.pipeline_rank == 0:
try:
batch_idx, (data, target) = next(self.dataloader)
batch_idx, ret = next(self.dataloader)
data = ret['text']
target = ret['text']
except StopIteration :
print("TRAINING COMPLETE")
return
Expand Down Expand Up @@ -163,7 +165,9 @@ def process_data(self, data:bytes, nodeid, addr):
self._apply_grad()
# print("\n\n\n\ncalculated")
try:
batch_idx, (data, target) = next(self.dataloader)
batch_idx, ret = next(self.dataloader)
data = ret['text']
target = ret['text']
except StopIteration :
print("TRAINING COMPLETE")
return
Expand Down Expand Up @@ -208,7 +212,9 @@ def process_data(self, data:bytes, nodeid, addr):
self._apply_grad()
if self.pipeline_rank == 0:
try:
batch_idx, (data, target) = next(self.dataloader)
batch_idx, ret = next(self.dataloader)
data = ret['text']
target = ret['text']
except StopIteration :
print("TRAINING COMPLETE")
return
Expand Down

0 comments on commit 997b49b

Please sign in to comment.