Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import os
|
|
7 |
from functools import lru_cache
|
8 |
from mtdna_classifier import classify_sample_location
|
9 |
import subprocess
|
|
|
10 |
|
11 |
@lru_cache(maxsize=128)
|
12 |
def classify_sample_location_cached(accession):
|
@@ -35,6 +36,11 @@ def compute_final_suggested_location(rows):
|
|
35 |
import gspread
|
36 |
from oauth2client.service_account import ServiceAccountCredentials
|
37 |
|
|
|
|
|
|
|
|
|
|
|
38 |
def store_feedback_to_google_sheets(accession, answer1, answer2, contact=""):
|
39 |
if not answer1.strip() or not answer2.strip():
|
40 |
return "⚠️ Please answer both questions before submitting."
|
|
|
7 |
from functools import lru_cache
|
8 |
from mtdna_classifier import classify_sample_location
|
9 |
import subprocess
|
10 |
+
import json
|
11 |
|
12 |
@lru_cache(maxsize=128)
|
13 |
def classify_sample_location_cached(accession):
|
|
|
36 |
import gspread
|
37 |
from oauth2client.service_account import ServiceAccountCredentials
|
38 |
|
39 |
+
creds_dict = json.loads(os.environ["GCP_CREDS_JSON"])
|
40 |
+
|
41 |
+
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
42 |
+
creds = ServiceAccountCredentials.from_json_keyfile_dict(creds_dict, scope)
|
43 |
+
|
44 |
def store_feedback_to_google_sheets(accession, answer1, answer2, contact=""):
|
45 |
if not answer1.strip() or not answer2.strip():
|
46 |
return "⚠️ Please answer both questions before submitting."
|