Spaces:
Runtime error
Runtime error
renhang
commited on
Commit
·
e26fb40
1
Parent(s):
bf8957d
update
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from pathlib import Path
|
|
| 10 |
from model import Jamify
|
| 11 |
from utils import json_to_text, text_to_json
|
| 12 |
|
| 13 |
-
def
|
| 14 |
"""Download examples data from GitHub repository if not already present"""
|
| 15 |
examples_dir = Path("examples")
|
| 16 |
if examples_dir.exists():
|
|
@@ -18,8 +18,14 @@ def download_examples_data():
|
|
| 18 |
repo_url = "https://github.com/xhhhhang/jam-examples.git"
|
| 19 |
subprocess.run(["git", "clone", repo_url, str(examples_dir)], check=True)
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
print('Downloading examples data...')
|
| 22 |
-
|
| 23 |
# Initialize the Jamify model once
|
| 24 |
print("Initializing Jamify model...")
|
| 25 |
jamify_model = Jamify()
|
|
|
|
| 10 |
from model import Jamify
|
| 11 |
from utils import json_to_text, text_to_json
|
| 12 |
|
| 13 |
+
def download_resources():
|
| 14 |
"""Download examples data from GitHub repository if not already present"""
|
| 15 |
examples_dir = Path("examples")
|
| 16 |
if examples_dir.exists():
|
|
|
|
| 18 |
repo_url = "https://github.com/xhhhhang/jam-examples.git"
|
| 19 |
subprocess.run(["git", "clone", repo_url, str(examples_dir)], check=True)
|
| 20 |
|
| 21 |
+
public_dir = Path("public")
|
| 22 |
+
if public_dir.exists():
|
| 23 |
+
subprocess.run(["rm", "-rf", str(public_dir)])
|
| 24 |
+
repo_url = "https://github.com/xhhhhang/jam-public.git"
|
| 25 |
+
subprocess.run(["git", "clone", repo_url, str(public_dir)], check=True)
|
| 26 |
+
|
| 27 |
print('Downloading examples data...')
|
| 28 |
+
download_resources()
|
| 29 |
# Initialize the Jamify model once
|
| 30 |
print("Initializing Jamify model...")
|
| 31 |
jamify_model = Jamify()
|