Uncategorized
add tokens to huggingface tokenizer
Here’s a sample code of how to load huggingface tokenizer, add some custom tokens and save it.
Uncategorized
visual code debug configuration variables
from the official docs: https://code.visualstudio.com/docs/editor/variables-reference Predefined variables The following predefined variables are supported: ${workspaceFolder} – the path of the folder opened in VS Code ${workspaceFolderBasename} – the name of the folder opened in VS Code without any slashes (/) ${file} – the current opened file ${fileWorkspaceFolder} – the current opened file’s workspace folder ${relativeFile} – Read more…
Uncategorized
install poppler in windows
download latest poppler package from here. unzip the downloaded file, and obtain the path of ‘poppler-xx.xx.x/Library/bin’ directory. Add this path to windows environment variable PATH.
Uncategorized
gitignore ignore config files except sample config file
I usually keep my configuration files under a directory named config but I don’t want these config files to be tracked by git. However, I do place a sample configuration file which I wish to be tracked by git. Normally, I name these sample configuration files as config.sample.yaml or config.sample.yaml. Read more…
Uncategorized
qt graphicsview zoom scrolling
https://stackoverflow.com/questions/19113532/qgraphicsview-zooming-in-and-out-under-mouse-position-using-mouse-wheel
Uncategorized
qt shift scroll horizontal direction
https://stackoverflow.com/questions/14610568/how-to-use-the-qgraphicsviews-translate-function
Uncategorized
color contrast aware random color selection
When generating synthetic image data, finding and using a pair of colors that are at least human readable is often useful. One crude way to do it is to find two colors in RGB space with minimum distance, but I find this method to be too crude and often it Read more…
Uncategorized
git ignoring files in dir except some file patterns
Problem In cases of config dirs, I want to add a sample config file to git but ignore non-sample files that is actually used in local. For example, I am using using_config.json but do not want this to be added to git. On the other hand I do want config.sample.json Read more…
Uncategorized
stop tracking files in visual code file explorer
From top menu, go to file – preferences – settings and type in files.exlude in search bar. There you can add patterns for files to ignore or untrack.