Skip to content

Instantly share code, notes, and snippets.

@kingabzpro
Created February 24, 2022 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingabzpro/e0fad7607dc7609d8adae63978236062 to your computer and use it in GitHub Desktop.
Save kingabzpro/e0fad7607dc7609d8adae63978236062 to your computer and use it in GitHub Desktop.
Deploying Gradio App on Spaces Using DagsHub
import os
PROD_MODEL_PATH = "src/models"
TRAIN_PATH = "src/data/processed/train/bathroom"
TEST_PATH = "src/data/processed/test/bathroom"
if os.path.isdir(".dvc"):
print("Running DVC")
os.system("dvc config cache.type copy")
os.system("dvc config core.no_scm true")
if os.system(f"dvc pull {PROD_MODEL_PATH} {TRAIN_PATH } {TEST_PATH }") != 0:
exit("dvc pull failed")
os.system("rm -r .dvc")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment