Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ if credentials.expired:
|
|
24 |
credentials.refresh(Request())
|
25 |
|
26 |
vertexai.init(location = "us-central1",
|
27 |
-
credentials =
|
28 |
project = project
|
29 |
)
|
30 |
|
@@ -35,6 +35,8 @@ def invoke(prompt):
|
|
35 |
if (prompt == ""):
|
36 |
raise gr.Error("Prompt is required.")
|
37 |
|
|
|
|
|
38 |
completion = ""
|
39 |
|
40 |
try:
|
@@ -55,7 +57,7 @@ def invoke(prompt):
|
|
55 |
return completion
|
56 |
|
57 |
description = """<a href='https://www.gradio.app/'>Gradio</a> UI using the <a href='https://cloud.google.com/vertex-ai'>Google Vertex AI</a> API
|
58 |
-
with Gemini Pro model.
|
59 |
|
60 |
gr.close_all()
|
61 |
|
|
|
24 |
credentials.refresh(Request())
|
25 |
|
26 |
vertexai.init(location = "us-central1",
|
27 |
+
credentials = credentials,
|
28 |
project = project
|
29 |
)
|
30 |
|
|
|
35 |
if (prompt == ""):
|
36 |
raise gr.Error("Prompt is required.")
|
37 |
|
38 |
+
raise gr.Error("Clone and bring your own credentials.")
|
39 |
+
|
40 |
completion = ""
|
41 |
|
42 |
try:
|
|
|
57 |
return completion
|
58 |
|
59 |
description = """<a href='https://www.gradio.app/'>Gradio</a> UI using the <a href='https://cloud.google.com/vertex-ai'>Google Vertex AI</a> API
|
60 |
+
with Gemini Pro model."""
|
61 |
|
62 |
gr.close_all()
|
63 |
|