bstraehle commited on
Commit
7a49355
·
1 Parent(s): d0ccbf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import json, os, vertexai, wandb
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
  wandb_api_key = os.environ["WANDB_API_KEY"]
10
 
@@ -26,7 +26,8 @@ if credentials.expired:
26
 
27
  vertexai.init(project = project,
28
  location = "us-central1",
29
- credentials = credentials)
 
30
 
31
  from vertexai.language_models import TextGenerationModel
32
  generation_model = TextGenerationModel.from_pretrained(config.model)
@@ -38,7 +39,7 @@ def invoke(prompt):
38
 
39
  description = """<a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://cloud.google.com/vertex-ai?hl=en/'>Google Vertex AI</a> API
40
  with Bison foundation model. Model performance evaluation via <a href='https://wandb.ai/bstraehle'>Weights & Biases</a>.
41
- Note: Credentials are commented out in this HF space."""
42
 
43
  gr.close_all()
44
  demo = gr.Interface(fn=invoke,
 
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
  wandb_api_key = os.environ["WANDB_API_KEY"]
10
 
 
26
 
27
  vertexai.init(project = project,
28
  location = "us-central1",
29
+ credentials = "" #credentials
30
+ )
31
 
32
  from vertexai.language_models import TextGenerationModel
33
  generation_model = TextGenerationModel.from_pretrained(config.model)
 
39
 
40
  description = """<a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://cloud.google.com/vertex-ai?hl=en/'>Google Vertex AI</a> API
41
  with Bison foundation model. Model performance evaluation via <a href='https://wandb.ai/bstraehle'>Weights & Biases</a>.
42
+ Note: Credentials are commented out in this HF space, you will get an error but can view the code."""
43
 
44
  gr.close_all()
45
  demo = gr.Interface(fn=invoke,