Spaces:
Sleeping
Sleeping
anmolsahai
commited on
Commit
•
d4aa661
1
Parent(s):
90ab706
gapic
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from langchain_core.prompts import PromptTemplate
|
|
5 |
from google.cloud import aiplatform_v1
|
6 |
import streamlit as st
|
7 |
import json
|
8 |
-
|
9 |
|
10 |
# Function to pad base64 strings
|
11 |
def pad_base64(base64_string):
|
@@ -20,8 +20,8 @@ if credentials_json:
|
|
20 |
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = credentials_path
|
21 |
|
22 |
# Initialize the Google AI Platform
|
23 |
-
client_options = {"api_endpoint": "us-central1-
|
24 |
-
client = aiplatform_v1.
|
25 |
|
26 |
# Define the documents as dictionaries, ensuring correct padding
|
27 |
documents = [
|
|
|
5 |
from google.cloud import aiplatform_v1
|
6 |
import streamlit as st
|
7 |
import json
|
8 |
+
from google.cloud.aiplatform_v1 import EndpointServiceClient
|
9 |
|
10 |
# Function to pad base64 strings
|
11 |
def pad_base64(base64_string):
|
|
|
20 |
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = credentials_path
|
21 |
|
22 |
# Initialize the Google AI Platform
|
23 |
+
client_options = {"api_endpoint": "us-central1-aiplatform.googleapis.com"}
|
24 |
+
client = aiplatform_v1.PipelineServiceClient(client_options=client_options)
|
25 |
|
26 |
# Define the documents as dictionaries, ensuring correct padding
|
27 |
documents = [
|