Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ project = os.environ["PROJECT"]
|
|
10 |
credentials = json.loads(credentials)
|
11 |
|
12 |
from google.oauth2 import service_account
|
13 |
-
|
14 |
credentials = service_account.Credentials.from_service_account_info(credentials)
|
15 |
|
16 |
if credentials.expired:
|
@@ -21,11 +20,9 @@ vertexai.init(project = project,
|
|
21 |
credentials = credentials)
|
22 |
|
23 |
from vertexai.language_models import TextGenerationModel
|
24 |
-
|
25 |
-
#generation_model = TextGenerationModel.from_pretrained("text-bison@001")
|
26 |
|
27 |
def invoke(prompt):
|
28 |
-
generation_model = TextGenerationModel.from_pretrained("text-bison@001")
|
29 |
return generation_model.predict(prompt = prompt).text
|
30 |
|
31 |
gr.close_all()
|
|
|
10 |
credentials = json.loads(credentials)
|
11 |
|
12 |
from google.oauth2 import service_account
|
|
|
13 |
credentials = service_account.Credentials.from_service_account_info(credentials)
|
14 |
|
15 |
if credentials.expired:
|
|
|
20 |
credentials = credentials)
|
21 |
|
22 |
from vertexai.language_models import TextGenerationModel
|
23 |
+
generation_model = TextGenerationModel.from_pretrained("text-bison@001")
|
|
|
24 |
|
25 |
def invoke(prompt):
|
|
|
26 |
return generation_model.predict(prompt = prompt).text
|
27 |
|
28 |
gr.close_all()
|