Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,10 @@ credentials = os.environ["CREDENTIALS"]
|
|
8 |
project = os.environ["PROJECT"]
|
9 |
wandb_api_key = os.environ["WANDB_API_KEY"]
|
10 |
|
11 |
-
|
12 |
-
#
|
13 |
-
|
|
|
14 |
|
15 |
wandb.login(key = wandb_api_key)
|
16 |
wandb.init(project = "vertex-ai-llm", config = config)
|
@@ -31,7 +32,6 @@ vertexai.init(project = project,
|
|
31 |
|
32 |
#from vertexai.language_models import TextGenerationModel
|
33 |
#generation_model = TextGenerationModel.from_pretrained(config.model)
|
34 |
-
|
35 |
from vertexai.preview.generative_models import GenerativeModel
|
36 |
generation_model = GenerativeModel("gemini-pro")
|
37 |
|
@@ -43,7 +43,7 @@ def invoke(prompt):
|
|
43 |
#return "Execution is commented out, but you can view the code at https://huggingface.co/spaces/bstraehle/google-vertex-ai-llm/tree/main."
|
44 |
|
45 |
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
|
46 |
-
with
|
47 |
|
48 |
gr.close_all()
|
49 |
demo = gr.Interface(fn=invoke,
|
|
|
8 |
project = os.environ["PROJECT"]
|
9 |
wandb_api_key = os.environ["WANDB_API_KEY"]
|
10 |
|
11 |
+
config = {
|
12 |
+
#"model": "text-bison@001",
|
13 |
+
"model": "gemini-pro",
|
14 |
+
}
|
15 |
|
16 |
wandb.login(key = wandb_api_key)
|
17 |
wandb.init(project = "vertex-ai-llm", config = config)
|
|
|
32 |
|
33 |
#from vertexai.language_models import TextGenerationModel
|
34 |
#generation_model = TextGenerationModel.from_pretrained(config.model)
|
|
|
35 |
from vertexai.preview.generative_models import GenerativeModel
|
36 |
generation_model = GenerativeModel("gemini-pro")
|
37 |
|
|
|
43 |
#return "Execution is commented out, but you can view the code at https://huggingface.co/spaces/bstraehle/google-vertex-ai-llm/tree/main."
|
44 |
|
45 |
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
|
46 |
+
with <s>text-bison@001</s> gemini-pro foundation model. Model performance evaluation via <a href='https://wandb.ai/bstraehle'>Weights & Biases</a>."""
|
47 |
|
48 |
gr.close_all()
|
49 |
demo = gr.Interface(fn=invoke,
|