Skip to content

Commit

Permalink
nits 2
Browse files Browse the repository at this point in the history
  • Loading branch information
henri123lemoine committed Sep 9, 2023
1 parent 15efdb8 commit f05c4a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions align_data/sources/articles/google_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def iterate_rows(sheet: Worksheet) -> Iterator[SheetRow]:
SheetRow.set_sheet(sheet)

# we start the enumeration at 2 to avoid the header row
for i, row_data in enumerate(sheet.get_all_records(), 2):
yield SheetRow(i, row_data)
for row_id, row_data in enumerate(sheet.get_all_records(), 2):
yield SheetRow(row_id, row_data)


def upload_file(filename, bytes_contents, mimetype, parent_id=None):
Expand Down
3 changes: 2 additions & 1 deletion align_data/sources/articles/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ def fetcher():
if contents := fetch_element(url, main_selector):
return list(filter(None, map(formatter, contents.select(item_selector))))
return []
fetcher.__name__ = formatter.__name__.replace("format_", "") + '_fetcher'
fetcher.__name__ = formatter.__name__.replace("format_", "") + '_fetcher'
# formatter called "format_anthropic" -> fetcher called "anthropic_fetcher"
#TODO: Make this more explicit
return fetcher


Expand Down
6 changes: 0 additions & 6 deletions align_data/sources/arxiv_papers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ def get_version(id: str) -> str | None:
return res.group(1)


def is_withdrawn(url: str):
if elem := fetch_element(canonical_url(url), ".extra-services .full-text ul"):
return elem.text.strip().lower() == "withdrawn"
return None


def is_withdrawn(url: str) -> bool:
if elem := fetch_element(canonical_url(url), '.extra-services .full-text ul'):
return elem.text.strip().lower() == 'withdrawn'
Expand Down
4 changes: 2 additions & 2 deletions align_data/sources/greaterwrong/greaterwrong.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ class GreaterWrong(AlignmentDataset):
start_year: int
min_karma: int
"""Posts must have at least this much karma to be returned."""
af: bool = False
af: bool
"""Whether alignment forum posts should be returned"""

limit = 50
COOLDOWN_TIME : float = 0.5
COOLDOWN_TIME: float = 0.5
done_key = "url"
lazy_eval = True
source_type = 'GreaterWrong'
Expand Down

0 comments on commit f05c4a9

Please sign in to comment.