spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Base Config Setup filepath issue

Open Mtaylert opened this issue 2 years ago • 1 comments

How to reproduce the behaviour

When initializing my configuration file, I set my train and dev paths as follows in my base_config.cfg:

train = 'data/train.spacy'
dev = 'data/valid.spacy'

After running python -m spacy init fill-config ./base_config.cfg ./config.cfg, the single quotes wrapping each file path result in the following

train = "'data/train.spacy'"
dev = "'data/valid.spacy'"

I'm wondering if there should be a fix to accept single quotes as a string wrappers instead of assume it is part of the literal path.

Your Environment

  • Operating System: Mac
  • Python Version Used: 3.9
  • spaCy Version Used: 3.1.3
  • Environment Information:

Mtaylert avatar Oct 13 '21 22:10 Mtaylert

I think the issue is that the values are parsed as JSON and JSON only supports double quotes. See: https://thinc.ai/docs/usage-config.

So I don't think we want to try to modify this behavior, but we can definitely think about how to document it more clearly.

adrianeboyd avatar Oct 14 '21 06:10 adrianeboyd

It's been a long time since this issue was raised, but thanks for bringing it up - I just added a check to confection in that should warn in cases like this in the future.

polm avatar Jan 12 '23 09:01 polm

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Feb 12 '23 00:02 github-actions[bot]