uce_demo / app_.py
minwoosun's picture
Create app_.py
609c477 verified
raw
history blame
1.08 kB
import gradio as gr
import pandas as pd
import umap
import matplotlib.pyplot as plt
import os
import tempfile
import scanpy as sc
import argparse
import subprocess
from io import BytesIO
from evaluate import AnndataProcessor
from accelerate import Accelerator
from huggingface_hub import hf_hub_download
def main(input_file_path, species):
# clone and cd into UCE repo
os.system('git clone https://github.com/minwoosun/UCE.git')
os.chdir('UCE')
# python eval_single_anndata.py --adata_path "./data/10k_pbmcs_proc.h5ad" --dir "./" --model_loc "minwoosun/uce-100m"
script_name = "eval_single_anndata.py"
args = ["--adata_path", input_file_path, "--dir", "./", "--model_loc", "minwoosun/uce-100m"]
command = ["python", script_name] + args
try:
result = subprocess.run(command, capture_output=True, text=True, check=True)
print(result.stdout)
print(result.stderr)
except subprocess.CalledProcessError as e:
print(f"Error executing command: {e}")
if __name__ == "__main__":