Skip to content

problem about cached_path #4

Description

@nuistlyk

here is the traceback

Traceback (most recent call last):
  File "spam_hunter.py", line 75, in <module>
    spamhunter =SpamHunter(start_time.strftime('%Y-%m-%dT%HZ'), end_time.strftime('%Y-%m-%dT%HZ'))
  File "spam_hunter.py", line 21, in __init__
    self.tweetDetector: TweetDetector = TweetDetector()
  File "/home/ykli/spamhunter/SpamHunter-main/detect_tweet_text.py", line 15, in __init__
    self.predictor = Predictor.from_path(self.model_path, predictor_name = "sentence_classifier")
  File "/home/ykli/sh/lib/python3.8/site-packages/allennlp/predictors/predictor.py", line 366, in from_path
    load_archive(archive_path, cuda_device=cuda_device, overrides=overrides),
  File "/home/ykli/sh/lib/python3.8/site-packages/allennlp/models/archival.py", line 206, in load_archive
    resolved_archive_file = cached_path(archive_file)
  File "/home/ykli/sh/lib/python3.8/site-packages/allennlp/common/file_utils.py", line 135, in cached_path
    _cached_path.file_friendly_logging(common_logging.FILE_FRIENDLY_LOGGING)
AttributeError: module 'cached_path' has no attribute 'file_friendly_logging'

I've solved this problem by set the version of cached_path to 1.1.2

pip install --upgrade cached_path==1.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions