Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static dir follow-ups #42

Closed
jaidhyani opened this issue Feb 21, 2024 · 2 comments
Closed

Static dir follow-ups #42

jaidhyani opened this issue Feb 21, 2024 · 2 comments
Assignees

Comments

@jaidhyani
Copy link
Collaborator

jaidhyani commented Feb 21, 2024

Minor follow-up tasks for scripts writing to the static output dir #41 (label_all_tokens.py)

  1. We shouldn't necessarily force the output into the STATIC_ASSETS_DIR. Especially if the user specified a full path or a partial path with directory references, e.g.:

/home/me/Desktop/tokens.csv
subdir/tokens.csv

In the first case, the user has specified a full path, and we should use it. In the second, we can assume they're referring to a relative path from the current working directory, and we should output there.

We can get that behavior by calling os.path.split on the path arg, which returns a (head,tail) tuple. If head is empty, the user just passed a filename and we can probably throw it in the default output dir. If head isn't empty, we can call os.path.expandvars on the path arg to get the path we should output to.

  1. We should also print the full path before writing, just to be explicit with the user about what file is being created and they know exactly where to look for it when it's done.

  2. We should print out something when the export has completed successfully.

@menamerai
Copy link
Collaborator

I'll get this done, ideally before Friday or during the weekend after the previous issue #41 is resolved and merged.

@menamerai menamerai linked a pull request Feb 26, 2024 that will close this issue
@menamerai
Copy link
Collaborator

@jaidhyani I think currently this issue won't have much of an impact on our library, since the token mapping will be uploaded to HF and not be locally saved, and Joshua already took care of the filepath option on his end. Should we keep this issue open?

@menamerai menamerai closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants