You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor follow-up tasks for scripts writing to the static output dir #41 (label_all_tokens.py)
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.
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.
We should print out something when the export has completed successfully.
The text was updated successfully, but these errors were encountered:
@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?
Minor follow-up tasks for scripts writing to the static output dir #41 (
label_all_tokens.py
)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. Ifhead
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 callos.path.expandvars
on the path arg to get the path we should output to.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.
We should print out something when the export has completed successfully.
The text was updated successfully, but these errors were encountered: