Skip to content

Commit

Permalink
adding importing from env
Browse files Browse the repository at this point in the history
  • Loading branch information
furniturewalatkNIH authored Nov 20, 2024
1 parent 0b5c513 commit c19fe7e
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions notebooks/GenAI/Gemini_Intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,22 @@
"import vertexai\n",
"from vertexai.generative_models import GenerativeModel, Image, GenerativeModel, ChatSession, Part, GenerationConfig\n",
"\n",
"# TODO(developer): Update and un-comment below lines\n",
"project_id = \"<PROJECT_ID>\"\n",
"location = \"<LOCATION>\" #(e.g., us-central1)\n",
"import json\n",
"# Load env.json\n",
"try:\n",
" with open(\"env.json\") as f:\n",
" config = json.load(f)\n",
"except FileNotFoundError:\n",
" config = {}\n",
"\n",
"# Assign parameters from Env.\n",
"project_id = config.get(\"NOTEBOOK_GCP_PROJECT_ID\")\n",
"location = config.get(\"NOTEBOOK_GCP_LOCATION\")\n",
"\n",
"# TODO( FOR developer): If not defined in ENV earlier, uncomment and add it below\n",
"#project_id = \"<PROJECT_ID>\"\n",
"#location = \"<LOCATION>\" #(e.g., us-central1)\n",
"\n",
"vertexai.init(project=project_id, location=location)"
]
},
Expand Down

0 comments on commit c19fe7e

Please sign in to comment.