-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_foundation_models.py
More file actions
38 lines (33 loc) · 1.1 KB
/
Copy pathlist_foundation_models.py
File metadata and controls
38 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from google.cloud import aiplatform
from vertexai.generative_models import GenerativeModel
import vertexai
# Initialize Vertex AI
vertexai.init(project='semgrep-472018', location='us-central1')
# List of available foundation models in Vertex AI
foundation_models = [
"gemini-1.5-pro-002",
"gemini-1.5-flash-002",
"gemini-1.5-flash",
"gemini-1.5-pro",
"gemini-1.0-pro",
"gemini-1.0-pro-vision",
"text-bison",
"text-bison-32k",
"code-bison",
"code-bison-32k",
]
print("Testing available foundation models in Vertex AI:\n")
print("=" * 50)
for model_name in foundation_models:
try:
model = GenerativeModel(model_name)
print(f"✓ {model_name:<25} - Available")
except Exception as e:
print(f"✗ {model_name:<25} - Not available: {str(e)[:50]}")
print("\n" + "=" * 50)
print("\nModels are enabled and ready to use!")
print("\nExample usage:")
print("from vertexai.generative_models import GenerativeModel")
print("model = GenerativeModel('gemini-1.5-flash')")
print("response = model.generate_content('Hello, world!')")
print("print(response.text)")