albertvillanova HF staff commited on
Commit
40b4fd1
1 Parent(s): b048e99

Fix AttributeError: 'Version' object has no attribute 'match' (#2)

Browse files

- Remove use of Version.match (5a9ab180f70b7ca578a5a2f34a54bbae582493f8)

Files changed (1) hide show
  1. visual_genome.py +2 -2
visual_genome.py CHANGED
@@ -314,7 +314,7 @@ class VisualGenomeConfig(datasets.BuilderConfig):
314
 
315
  @property
316
  def annotations_url(self):
317
- if self.version.match(_LATEST_VERSIONS[self._name_without_version]):
318
  return f"{_BASE_ANNOTATION_URL}/{self._name_without_version}.json.zip"
319
 
320
  major, minor = self.version.major, self.version.minor
@@ -325,7 +325,7 @@ class VisualGenomeConfig(datasets.BuilderConfig):
325
 
326
  @property
327
  def image_metadata_url(self):
328
- if not self.version.match(_LATEST_VERSIONS["image_metadata"]):
329
  logger.warning(
330
  f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions."
331
  )
 
314
 
315
  @property
316
  def annotations_url(self):
317
+ if self.version == _LATEST_VERSIONS[self._name_without_version]:
318
  return f"{_BASE_ANNOTATION_URL}/{self._name_without_version}.json.zip"
319
 
320
  major, minor = self.version.major, self.version.minor
 
325
 
326
  @property
327
  def image_metadata_url(self):
328
+ if not self.version == _LATEST_VERSIONS["image_metadata"]:
329
  logger.warning(
330
  f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions."
331
  )