Spaces:
Running
Running
Update mtdna_backend.py
Browse files- mtdna_backend.py +3 -0
mtdna_backend.py
CHANGED
@@ -25,6 +25,7 @@ import threading
|
|
25 |
#@lru_cache(maxsize=3600)
|
26 |
def pipeline_classify_sample_location_cached(accession,stop_flag=None, save_df=None):
|
27 |
print("inside pipeline_classify_sample_location_cached, and [accession] is ", [accession])
|
|
|
28 |
return pipeline.pipeline_with_gemini([accession],stop_flag=stop_flag, save_df=save_df)
|
29 |
|
30 |
# Count and suggest final location
|
@@ -170,6 +171,7 @@ def summarize_results(accession, stop_flag=None):
|
|
170 |
return None
|
171 |
|
172 |
save_df = pd.DataFrame(data[1:], columns=data[0])
|
|
|
173 |
outputs = pipeline_classify_sample_location_cached(accession, stop_flag, save_df)
|
174 |
if stop_flag is not None and stop_flag.value:
|
175 |
print(f"🛑 Skipped {accession} mid-pipeline.")
|
@@ -538,6 +540,7 @@ def save_batch_output(all_rows, output_type, summary_text=None, flag_text=None):
|
|
538 |
# print(f"⚠️ Failed to load known samples from Google Sheets: {e}")
|
539 |
# return None
|
540 |
def check_known_output(accession):
|
|
|
541 |
try:
|
542 |
# ✅ Load credentials from Hugging Face secret
|
543 |
creds_dict = json.loads(os.environ["GCP_CREDS_JSON"])
|
|
|
25 |
#@lru_cache(maxsize=3600)
|
26 |
def pipeline_classify_sample_location_cached(accession,stop_flag=None, save_df=None):
|
27 |
print("inside pipeline_classify_sample_location_cached, and [accession] is ", [accession])
|
28 |
+
print("len of save df: ", len(save_df))
|
29 |
return pipeline.pipeline_with_gemini([accession],stop_flag=stop_flag, save_df=save_df)
|
30 |
|
31 |
# Count and suggest final location
|
|
|
171 |
return None
|
172 |
|
173 |
save_df = pd.DataFrame(data[1:], columns=data[0])
|
174 |
+
print("before pipeline, len of save df: ", len(save_df))
|
175 |
outputs = pipeline_classify_sample_location_cached(accession, stop_flag, save_df)
|
176 |
if stop_flag is not None and stop_flag.value:
|
177 |
print(f"🛑 Skipped {accession} mid-pipeline.")
|
|
|
540 |
# print(f"⚠️ Failed to load known samples from Google Sheets: {e}")
|
541 |
# return None
|
542 |
def check_known_output(accession):
|
543 |
+
print("inside check known output function")
|
544 |
try:
|
545 |
# ✅ Load credentials from Hugging Face secret
|
546 |
creds_dict = json.loads(os.environ["GCP_CREDS_JSON"])
|