Skip to content

Commit

Permalink
fix indentation error, ci:execute
Browse files Browse the repository at this point in the history
  • Loading branch information
iamzoltan committed Apr 3, 2024
1 parent 46d581f commit 0c44408
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1706,16 +1706,16 @@
"source": [
"import requests\n",
"\n",
" def query(payload, model_id, api_token):\n",
"def query(payload, model_id, api_token):\n",
" headers = {\"Authorization\": f\"Bearer {api_token}\"}\n",
" API_URL = f\"https://api-inference.huggingface.co/models/{model_id}\"\n",
" response = requests.post(API_URL, headers=headers, json=payload)\n",
" return response.json()\n",
"\n",
" model_id = \"gpt2\"\n",
" api_token = \"hf_****\" # get yours at hf.co/settings/tokens\n",
" data = query(\"The goal of life is\", model_id, api_token)\n",
" print(data)"
"model_id = \"gpt2\"\n",
"api_token = \"hf_****\" # get yours at hf.co/settings/tokens\n",
"data = query(\"The goal of life is\", model_id, api_token)\n",
"print(data)"
]
},
{
Expand Down

0 comments on commit 0c44408

Please sign in to comment.