Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,6 @@ from vertexai.language_models import TextGenerationModel
|
|
32 |
generation_model = TextGenerationModel.from_pretrained("text-bison@001")
|
33 |
|
34 |
def invoke(prompt, credentials):
|
35 |
-
//
|
36 |
credentials = json.loads(credentials)
|
37 |
credentials = service_account.Credentials.from_service_account_info(credentials)
|
38 |
if credentials.expired:
|
@@ -40,7 +39,6 @@ def invoke(prompt, credentials):
|
|
40 |
vertexai.init(project = project,
|
41 |
location = "us-central1",
|
42 |
credentials = credentials)
|
43 |
-
//
|
44 |
completion = generation_model.predict(prompt = prompt).text
|
45 |
wandb.log({"prompt": prompt, "completion": completion})
|
46 |
return completion
|
|
|
32 |
generation_model = TextGenerationModel.from_pretrained("text-bison@001")
|
33 |
|
34 |
def invoke(prompt, credentials):
|
|
|
35 |
credentials = json.loads(credentials)
|
36 |
credentials = service_account.Credentials.from_service_account_info(credentials)
|
37 |
if credentials.expired:
|
|
|
39 |
vertexai.init(project = project,
|
40 |
location = "us-central1",
|
41 |
credentials = credentials)
|
|
|
42 |
completion = generation_model.predict(prompt = prompt).text
|
43 |
wandb.log({"prompt": prompt, "completion": completion})
|
44 |
return completion
|