Update app.py
Browse files
app.py
CHANGED
@@ -15,17 +15,17 @@ config = {
|
|
15 |
"top_p": 1.0,
|
16 |
}
|
17 |
|
18 |
-
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
|
@@ -60,7 +60,7 @@ description = """<a href='https://www.gradio.app/'>Gradio</a> UI using the <a hr
|
|
60 |
gr.close_all()
|
61 |
|
62 |
demo = gr.Interface(fn = invoke,
|
63 |
-
inputs = [gr.Textbox(label = "Prompt", lines = 1)],
|
64 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
65 |
title = "Generative AI - LLM",
|
66 |
description = description)
|
|
|
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
|
|
|
60 |
gr.close_all()
|
61 |
|
62 |
demo = gr.Interface(fn = invoke,
|
63 |
+
inputs = [gr.Textbox(label = "Prompt", value = "hi", lines = 1)],
|
64 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
65 |
title = "Generative AI - LLM",
|
66 |
description = description)
|