There are several ways to clone a repository from github. Similar from other providers, such as bitbucket, gitlab, etc.
https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
Mostly, we use
- http
- ssh
| import os, torch, torch.multiprocessing as mp | |
| from transformers import AutoModelForCausalLM, LlamaConfig | |
| CHECK_EQUAL_WITH_HF = '' # A pretrain directory eg. '/data/models/llama-2-hf/7b-chat' | |
| def add_arguments(parser): | |
| group = parser.add_argument_group(title='Llama-2 HF saver.') | |
| group.add_argument('--megatron-path', type=str, default=None, | |
| help='Base directory of megatron checkpoint') |
There are several ways to clone a repository from github. Similar from other providers, such as bitbucket, gitlab, etc.
https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
Mostly, we use
| # Extended python -m http.serve with --username and --password parameters for | |
| # basic auth, based on https://gist.github.com/fxsjy/5465353 | |
| from functools import partial | |
| from http.server import SimpleHTTPRequestHandler, test | |
| import base64 | |
| import os | |
| class AuthHTTPRequestHandler(SimpleHTTPRequestHandler): |
jq — https://jqlang.org/ — "like sed for JSON data"
There are several options available for installing jq.
I prefer to use Homebrew: brew install jq
So you went live and you want everyone to know. Here's how you do it:
Go to https://ifttt.com/ and create an account (if you don't already have one)
Its easy to setup a LAN between two Ubuntu machines connected over ethernet. If one of those machines, which we will call the server, is also connected to the internet via another device (like a wireless card) it will automagically share its internet connection as well. Begin by connecting the client and server machines via ethernet.
On the server machine, click the network icon on the top right and select "Edit Connections > Wired connection 1 > Edit > IPv4 Settings" and change "Method" to "Shared to other computers". Then open the network icon menu again and click "Wired connection 1" to ensure that the connection has been established. Running ifconfig in the terminal should show that the wired interface has an ip address.
On the client machine, click the network icon on the top right and select "Wired connection 1". All done. Run ifconfig on this machine as well to see the ip address you've been assigned.
| // set use_cholesky if M is symmetric - it's faster and more stable | |
| // for dep paring it won't be | |
| template <typename MatrixType> | |
| inline typename MatrixType::Scalar logdet(const MatrixType& M, bool use_cholesky = false) { | |
| using namespace Eigen; | |
| using std::log; | |
| typedef typename MatrixType::Scalar Scalar; | |
| Scalar ld = 0; | |
| if (use_cholesky) { | |
| LLT<Matrix<Scalar,Dynamic,Dynamic>> chol(M); |