Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
henri123lemoine committed Aug 16, 2023
1 parent 03d0d54 commit 041d48f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions align_data/finetuning/finetuning_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import random
from typing import List, Tuple, Generator

import torch
from sqlalchemy import func
from torch.utils.data import IterableDataset
from torch.utils.data import IterableDataset, get_worker_info

from align_data.pinecone.pinecone_db_handler import PineconeDB
from align_data.pinecone.text_splitter import ParagraphSentenceUnitTextSplitter
Expand Down Expand Up @@ -39,7 +37,7 @@ def __init__(
self.total_articles = session.query(Article).count()

def __iter__(self):
worker_info = torch.utils.data.get_worker_info()
worker_info = get_worker_info()
if worker_info is None: # Single-process loading
return self._generate_pairs()
else: # Multi-process loading
Expand Down

0 comments on commit 041d48f

Please sign in to comment.