msagbohan commited on
Commit
1795b93
·
verified ·
1 Parent(s): b06a707

Update annotator.py

Browse files
Files changed (1) hide show
  1. annotator.py +3 -2
annotator.py CHANGED
@@ -4,6 +4,7 @@ import ast
4
  import pandas as pd
5
  import gspread
6
  from google.oauth2 import service_account
 
7
  import glob
8
  import soundfile as sf
9
  from maad import sound
@@ -19,12 +20,12 @@ import matplotlib.pyplot as plt
19
  logging.basicConfig(level=logging.DEBUG)
20
  logger = logging.getLogger(__name__)
21
 
22
- sh_auth = ast.literal_eval(os.getenv("gcp_service_account"))
23
 
24
  @st.cache_resource
25
  def authorize_google_sheets():
26
  scope = ["https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/drive"]
27
- creds = service_account.Credentials.from_service_account_info(sh_auth, scopes=scope)
28
  client = gspread.authorize(creds)
29
  return client
30
 
 
4
  import pandas as pd
5
  import gspread
6
  from google.oauth2 import service_account
7
+ from google.oauth2.service_account import Credentials
8
  import glob
9
  import soundfile as sf
10
  from maad import sound
 
20
  logging.basicConfig(level=logging.DEBUG)
21
  logger = logging.getLogger(__name__)
22
 
23
+ #sh_auth = ast.literal_eval(os.getenv("gcp_service_account"))
24
 
25
  @st.cache_resource
26
  def authorize_google_sheets():
27
  scope = ["https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/drive"]
28
+ creds = Credentials.from_service_account_info(gcp_service_account, scopes=scope)
29
  client = gspread.authorize(creds)
30
  return client
31