Update run.py
Browse files
run.py
CHANGED
|
@@ -6,6 +6,7 @@ from huggingface_hub import InferenceClient
|
|
| 6 |
import gspread
|
| 7 |
from oauth2client.service_account import ServiceAccountCredentials
|
| 8 |
from datetime import datetime
|
|
|
|
| 9 |
|
| 10 |
# Google Sheets setup
|
| 11 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
|
@@ -23,7 +24,7 @@ json_data={
|
|
| 23 |
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/nestoleservice%40nestolechatbot.iam.gserviceaccount.com",
|
| 24 |
"universe_domain": "googleapis.com"
|
| 25 |
}
|
| 26 |
-
creds =
|
| 27 |
|
| 28 |
|
| 29 |
#creds = ServiceAccountCredentials.from_json_keyfile_name('/home/user/app/chromaold/nestolechatbot-5fe2aa26cb52.json', scope)
|
|
|
|
| 6 |
import gspread
|
| 7 |
from oauth2client.service_account import ServiceAccountCredentials
|
| 8 |
from datetime import datetime
|
| 9 |
+
from google.oauth2 import service_account
|
| 10 |
|
| 11 |
# Google Sheets setup
|
| 12 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
|
|
|
| 24 |
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/nestoleservice%40nestolechatbot.iam.gserviceaccount.com",
|
| 25 |
"universe_domain": "googleapis.com"
|
| 26 |
}
|
| 27 |
+
creds = service_account.Credentials.from_service_account_info(json_data, scope)
|
| 28 |
|
| 29 |
|
| 30 |
#creds = ServiceAccountCredentials.from_json_keyfile_name('/home/user/app/chromaold/nestolechatbot-5fe2aa26cb52.json', scope)
|