bstraehle commited on
Commit
0c09b64
·
verified ·
1 Parent(s): 9fc038c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -4,8 +4,8 @@ import json, os, vertexai
4
  from dotenv import load_dotenv, find_dotenv
5
  _ = load_dotenv(find_dotenv())
6
 
7
- credentials = "BringYourOwn" #os.environ["CREDENTIALS"]
8
- project = "BringYourOwn" #os.environ["PROJECT"]
9
 
10
  config = {
11
  "max_output_tokens": 1000,
@@ -15,17 +15,17 @@ config = {
15
  "top_p": 1.0,
16
  }
17
 
18
- #credentials = json.loads(credentials)
19
 
20
- #from google.oauth2 import service_account
21
- #credentials = service_account.Credentials.from_service_account_info(credentials)
22
 
23
- #if credentials.expired:
24
- # credentials.refresh(Request())
25
 
26
- vertexai.init(project = project,
27
- location = "us-central1",
28
- credentials = "" #credentials
29
  )
30
 
31
  from vertexai.preview.generative_models import GenerativeModel
 
4
  from dotenv import load_dotenv, find_dotenv
5
  _ = load_dotenv(find_dotenv())
6
 
7
+ credentials = os.environ["CREDENTIALS"]
8
+ project = os.environ["PROJECT"]
9
 
10
  config = {
11
  "max_output_tokens": 1000,
 
15
  "top_p": 1.0,
16
  }
17
 
18
+ credentials = json.loads(credentials)
19
 
20
+ from google.oauth2 import service_account
21
+ credentials = service_account.Credentials.from_service_account_info(credentials)
22
 
23
+ if credentials.expired:
24
+ credentials.refresh(Request())
25
 
26
+ vertexai.init(location = "us-central1",
27
+ credentials = "BringYourOwn", #credentials,
28
+ project = "BringYourOwn" #project
29
  )
30
 
31
  from vertexai.preview.generative_models import GenerativeModel