FrancescoLR commited on
Commit
6359287
·
verified ·
1 Parent(s): 41f5018

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -1,9 +1,15 @@
1
  import subprocess
 
2
 
3
- # Find where mednextv1 is installed
4
- subprocess.run(["find", "/usr/local/lib/python3.10/site-packages", "-name", "mednextv1"])
5
-
6
 
 
 
 
 
 
 
7
 
8
  import gradio as gr
9
  import torch
 
1
  import subprocess
2
+ import sys
3
 
4
+ print("Installing mednextv1...")
5
+ subprocess.run([sys.executable, "-m", "pip", "install", "--force-reinstall", "git+https://github.com/FrancescoLR/MedNeXt.git"])
 
6
 
7
+ try:
8
+ from mednextv1 import create_mednext_encoder_v1
9
+ print("Successfully imported mednextv1!")
10
+ except ModuleNotFoundError:
11
+ print("ERROR: mednextv1 still not found after reinstalling!")
12
+
13
 
14
  import gradio as gr
15
  import torch