This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # train_grpo.py | |
| import re | |
| import torch | |
| from datasets import load_dataset, Dataset | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import LoraConfig | |
| from trl import GRPOConfig, GRPOTrainer | |
| # Load and prep dataset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################################ | |
| # # | |
| # ------- Useful Docker Aliases -------- # | |
| # # | |
| # # Installation : # | |
| # copy/paste these lines into your .bashrc or .zshrc file or just # | |
| # type the following in your current shell to try it out: # | |
| # wget -O - https://gist.github.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash | |
| # # | |
| # # Usage: # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias dm='docker-machine' | |
| alias dmx='docker-machine ssh' | |
| alias dk='docker' | |
| alias dki='docker images' | |
| alias dks='docker service' | |
| alias dkrm='docker rm' | |
| alias dkl='docker logs' | |
| alias dklf='docker logs -f' | |
| alias dkflush='docker rm `docker ps --no-trunc -aq`' | |
| alias dkflush2='docker rmi $(docker images --filter "dangling=true" -q --no-trunc)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # tmxsync: bring all windows as panes into one window and activate the "synchronize-panes" option | |
| # tmxunsync: split all panes into different windows and deactivate the "synchronize-panes" option. | |
| # Licence: | |
| # To the extent possible under law I, Konstantinos Koukopoulos, have waived all copyright and related or neighboring rights to tmxsync.sh, as describe by the CC0 document: | |
| # http://creativecommons.org/publicdomain/zero/1.0/ | |
| # This work is published from: Greece. | |
| tmxsync () { | |
| export _TMUX_SYNC=1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # tmxsync: bring all windows as panes into one window and activate the "synchronize-panes" option | |
| # tmxunsync: split all panes into different windows and deactivate the "synchronize-panes" option. | |
| # Licence: | |
| # To the extent possible under law I, Konstantinos Koukopoulos, have waived all copyright and related or neighboring rights to tmxsync.sh, as describe by the CC0 document: | |
| # http://creativecommons.org/publicdomain/zero/1.0/ | |
| # This work is published from: Greece. | |
| tmxsync () { | |
| export _TMUX_SYNC=1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run \ | |
| --name={{.Name}} \ | |
| {{range $e := .Config.Env}}--env={{printf "%q" $e}} \ | |
| {{end}}{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \ | |
| {{end}}{{end}}{{range $n, $conf := .NetworkSettings.Networks}}{{with $conf}}--network {{printf "%q" $n}} \ | |
| {{range $conf.Aliases}}--network-alias {{printf "%q" .}} {{end}} \ | |
| {{end}}{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from={{printf "%q" .}} \ | |
| {{end}}{{range $v := .HostConfig.Binds}}--volume={{printf "%q" .}} \ | |
| {{end}}{{range $l, $v := .Config.Labels}}--label {{printf "%q" $l}}={{printf "%q" $v}} \ | |
| {{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{printf "%q" .}} \ |