Install the transformers library when running on Colab

main
Aurélien Geron 2021-03-02 11:10:15 +13:00
parent 0a55f55372
commit 3d418c0308
1 changed files with 1 additions and 1 deletions

View File

@ -57,6 +57,7 @@
" # %tensorflow_version only exists in Colab.\n",
" %tensorflow_version 2.x\n",
" !pip install -q -U tensorflow-addons\n",
" !pip install -q -U transformers\n",
" IS_COLAB = True\n",
"except Exception:\n",
" IS_COLAB = False\n",
@ -2615,7 +2616,6 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install -q -U transformers\n",
"from transformers import TFOpenAIGPTLMHeadModel\n",
"\n",
"model = TFOpenAIGPTLMHeadModel.from_pretrained(\"openai-gpt\")"