Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,15 +8,8 @@ from transformers import pipeline
|
|
8 |
from google.genai import types
|
9 |
import gradio as gr
|
10 |
import os, json
|
11 |
-
from google.oauth2 import service_account
|
12 |
-
sa_info = json.loads(os.getenv("GCP_SERVICE_ACCOUNT_JSON"))
|
13 |
-
credentials = service_account.Credentials.from_service_account_info(
|
14 |
-
sa_info,
|
15 |
-
scopes=["https://www.googleapis.com/auth/cloud-platform"]
|
16 |
-
)
|
17 |
|
18 |
-
|
19 |
-
with open("/tmp/sa.json","w") as f: f.write(json.dumps(sa_info))
|
20 |
apikey = "AIzaSyCeY0ji2gnMwvP8jGCU_Z5DG6m9Ybo3JeE" # Replace or use os.getenv if secret
|
21 |
|
22 |
# Configure Gemini API for drafting (free)
|
@@ -42,7 +35,7 @@ client = genai.Client(
|
|
42 |
vertexai=True,
|
43 |
project="217758598930",
|
44 |
location="us-central1",
|
45 |
-
|
46 |
)
|
47 |
|
48 |
model = "projects/217758598930/locations/us-central1/endpoints/1940344453420023808"
|
|
|
8 |
from google.genai import types
|
9 |
import gradio as gr
|
10 |
import os, json
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
|
|
|
13 |
apikey = "AIzaSyCeY0ji2gnMwvP8jGCU_Z5DG6m9Ybo3JeE" # Replace or use os.getenv if secret
|
14 |
|
15 |
# Configure Gemini API for drafting (free)
|
|
|
35 |
vertexai=True,
|
36 |
project="217758598930",
|
37 |
location="us-central1",
|
38 |
+
|
39 |
)
|
40 |
|
41 |
model = "projects/217758598930/locations/us-central1/endpoints/1940344453420023808"
|