mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2025-09-02 21:07:52 +00:00
move access token to config.json
This commit is contained in:
parent
58df945ed4
commit
6bc3de165c
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
# Configs and keys
|
# Configs and keys
|
||||||
|
ch05/07_gpt_to_llama/config.json
|
||||||
ch07/02_dataset-utilities/config.json
|
ch07/02_dataset-utilities/config.json
|
||||||
ch07/03_model-evaluation/config.json
|
ch07/03_model-evaluation/config.json
|
||||||
|
|
||||||
@ -95,6 +96,7 @@ ch07/04_preference-tuning-with-dpo/loss-plot.pdf
|
|||||||
ch0?/0?_user_interface/.chainlit/
|
ch0?/0?_user_interface/.chainlit/
|
||||||
ch0?/0?_user_interface/chainlit.md
|
ch0?/0?_user_interface/chainlit.md
|
||||||
ch0?/0?_user_interface/.files
|
ch0?/0?_user_interface/.files
|
||||||
|
*.lock
|
||||||
|
|
||||||
# Temporary OS-related files
|
# Temporary OS-related files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
4
ch05/07_gpt_to_llama/config.json
Normal file
4
ch05/07_gpt_to_llama/config.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"HF_ACCESS_TOKEN": "hf-...",
|
||||||
|
"_comment": "Enter your access token from https://huggingface.co/settings/tokens"
|
||||||
|
}
|
@ -733,8 +733,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "raw",
|
"cell_type": "markdown",
|
||||||
"id": "aa79780d-74a8-4ee0-934a-9ad63205a02e",
|
"id": "ba5d991a-559b-47be-96f4-31b881ab2da8",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"id": "aa79780d-74a8-4ee0-934a-9ad63205a02e"
|
"id": "aa79780d-74a8-4ee0-934a-9ad63205a02e"
|
||||||
},
|
},
|
||||||
@ -1104,7 +1104,11 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"from huggingface_hub import login\n",
|
"from huggingface_hub import login\n",
|
||||||
"\n",
|
"\n",
|
||||||
"login(token=\"hf_...\") # Insert your token here"
|
"with open(\"config.json\", \"r\") as config_file:\n",
|
||||||
|
" config = json.load(config_file)\n",
|
||||||
|
" access_token = config[\"HF_ACCESS_TOKEN\"]\n",
|
||||||
|
"\n",
|
||||||
|
"login(token=access_token)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user