chris1nexus
commited on
Commit
•
9b08ae2
1
Parent(s):
59d718b
Update app
Browse files- app.py +15 -10
- requirements.txt +5 -5
app.py
CHANGED
@@ -10,6 +10,18 @@ def load_model():
|
|
10 |
predictor = Predictor()
|
11 |
return predictor
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
def main():
|
14 |
|
15 |
|
@@ -154,14 +166,7 @@ def main():
|
|
154 |
st.markdown(CONTACT_TEXT)
|
155 |
|
156 |
if __name__ == '__main__':
|
157 |
-
'''
|
158 |
-
|
159 |
-
|
160 |
-
os.system("pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.1+cu113.html")
|
161 |
-
os.system("pip install torch-geometric -f https://pytorch-geometric.com/whl/torch-1.7.1+cu113.html")
|
162 |
-
else:
|
163 |
-
os.system("pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.1+cpu.html")
|
164 |
-
os.system("pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.1+cpu.html")
|
165 |
-
os.system("pip install torch-geometric -f https://pytorch-geometric.com/whl/torch-1.7.1+cpu.html")
|
166 |
-
'''
|
167 |
main()
|
|
|
10 |
predictor = Predictor()
|
11 |
return predictor
|
12 |
|
13 |
+
@st.cache(suppress_st_warning=True)
|
14 |
+
def load_dependencies():
|
15 |
+
if torch.cuda.is_available():
|
16 |
+
os.system("pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.1+cu113.html")
|
17 |
+
os.system("pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.1+cu113.html")
|
18 |
+
os.system("pip install torch-geometric -f https://pytorch-geometric.com/whl/torch-1.7.1+cu113.html")
|
19 |
+
else:
|
20 |
+
os.system("pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.1+cpu.html")
|
21 |
+
os.system("pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.7.1+cpu.html")
|
22 |
+
os.system("pip install torch-geometric -f https://pytorch-geometric.com/whl/torch-1.7.1+cpu.html")
|
23 |
+
|
24 |
+
|
25 |
def main():
|
26 |
|
27 |
|
|
|
166 |
st.markdown(CONTACT_TEXT)
|
167 |
|
168 |
if __name__ == '__main__':
|
169 |
+
#'''
|
170 |
+
load_dependencies()
|
171 |
+
#'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
main()
|
requirements.txt
CHANGED
@@ -4,12 +4,12 @@ streamlit
|
|
4 |
#-f https://data.pyg.org/whl/torch-1.7.1+cpu.html
|
5 |
#torch==1.7.1+cpu
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
torch
|
13 |
torchvision
|
14 |
torch-scatter
|
15 |
torch-sparse
|
|
|
4 |
#-f https://data.pyg.org/whl/torch-1.7.1+cpu.html
|
5 |
#torch==1.7.1+cpu
|
6 |
|
7 |
+
-f https://download.pytorch.org/whl/torch_stable.html
|
8 |
+
-f https://data.pyg.org/whl/torch-1.10.0+cu113.html
|
9 |
+
torch==1.10.0+cu113
|
10 |
|
11 |
+
#-f https://download.pytorch.org/whl/cpu/torch_stable.html
|
12 |
+
#torch
|
13 |
torchvision
|
14 |
torch-scatter
|
15 |
torch-sparse
|