Skip to content

Commit b68a6d2

Browse files
authored
Merge pull request #307 from madroidmaq/master
Jupter Notebook: Add run Meta's Llama 2 models
2 parents 57bf0e9 + 9fbe96f commit b68a6d2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

run.ipynb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,27 @@
8989
"cmd = f'./run {model_file} -t {temperature} -p {top_p} -n {max_token} -i \"{prompt}\"'\n",
9090
"!{cmd}"
9191
]
92+
},
93+
{
94+
"cell_type": "code",
95+
"execution_count": null,
96+
"metadata": {},
97+
"outputs": [],
98+
"source": [
99+
"#@title Run Meta's Llama 2 models\n",
100+
"\n",
101+
"#@markdown input your huggingface [access token](https://huggingface.co/settings/tokens) to download Meta's Llama 2 models.\n",
102+
"\n",
103+
"from huggingface_hub import snapshot_download\n",
104+
"\n",
105+
"token = \"replace your huggingface access token\" #@param {type:\"string\"}\n",
106+
"path = snapshot_download(repo_id=\"meta-llama/Llama-2-7b\",cache_dir=\"Llama-2-7b\", use_auth_token=token)\n",
107+
"\n",
108+
"!python export_meta_llama_bin.py $path llama2_7b.bin\n",
109+
"\n",
110+
"print(\"./run llama2_7b.bin\\n\")\n",
111+
"!./run llama2_7b.bin"
112+
]
92113
}
93114
],
94115
"metadata": {

0 commit comments

Comments
 (0)