RandomCatLover commited on
Commit
ac8bc5e
·
1 Parent(s): 25e10f4
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -6,6 +6,19 @@ if os.path.exists('.env'):
6
  from dotenv import load_dotenv
7
  load_dotenv()
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  if not os.path.exists(destination):
10
  import subprocess
11
  repo_url = os.getenv("GIT_CORE")
@@ -28,17 +41,6 @@ if not os.path.exists(img_qua_path):
28
  except subprocess.CalledProcessError as e:
29
  print(f'Error cloning repository: {e.output.decode()}')
30
 
31
- dest = 'melanoma_detection_model_registry'
32
- if not os.path.exists(img_qua_path):
33
- import subprocess
34
- repo_url = 'https://huggingface.co/RandomCatLover/melanoma_detection_model_registry'
35
- command = f'git clone {repo_url} {dest}'
36
- try:
37
- subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)#, env=env)
38
- print('Repository cloned successfully.')
39
- except subprocess.CalledProcessError as e:
40
- print(f'Error cloning repository: {e.output.decode()}')
41
-
42
  from core.s import demo
43
 
44
  demo.queue(concurrency_count=3)
 
6
  from dotenv import load_dotenv
7
  load_dotenv()
8
 
9
+ dest = 'melanoma_detection_model_registry'
10
+ if not os.path.exists(dest):
11
+ from huggingface_hub import snapshot_download
12
+ import joblib
13
+
14
+ REPO_ID = "YOUR_REPO_ID"
15
+ FILENAME = "sklearn_model.joblib"
16
+
17
+ print('loading model')
18
+
19
+ snapshot_download(repo_id='RandomCatLover/melanoma_detection_model_registry', local_dir=dest, local_dir_use_symlinks=False)
20
+
21
+
22
  if not os.path.exists(destination):
23
  import subprocess
24
  repo_url = os.getenv("GIT_CORE")
 
41
  except subprocess.CalledProcessError as e:
42
  print(f'Error cloning repository: {e.output.decode()}')
43
 
 
 
 
 
 
 
 
 
 
 
 
44
  from core.s import demo
45
 
46
  demo.queue(concurrency_count=3)