ManasSharma07 commited on
Commit
c38eeda
·
verified ·
1 Parent(s): 3f4978b

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +23 -23
src/streamlit_app.py CHANGED
@@ -21,31 +21,31 @@ import subprocess
21
  import sys
22
  import pkg_resources
23
 
24
- try:
25
- subprocess.check_call([sys.executable, "-m", "pip", "install", "mattersim"])
26
- except Exception as e:
27
- print(f"Error during installation of mattersim: {e}")
28
 
29
- try:
30
- from mattersim.forcefield import MatterSimCalculator
31
- mattersim_available = True
32
- print("\n\n\n\n\n\n\nSuccessfully imported MatterSimCalculator.\n\n\n\n\n\n\n\n\n\n")
33
- except ImportError as e:
34
- print(f"Failed to import MatterSimCalculator: {e} \n\n\n\n\n\n\n\n")
35
- mattersim_available = False
36
- # Define version threshold
37
- required_version = "2.0.0"
38
 
39
- try:
40
- installed_version = pkg_resources.get_distribution("numpy").version
41
- if pkg_resources.parse_version(installed_version) >= pkg_resources.parse_version(required_version):
42
- print(f"numpy version {installed_version} >= {required_version}. Installing numpy<2.0.0...")
43
- subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy<2.0.0"])
44
- else:
45
- print(f"numpy version {installed_version} is already < {required_version}. No action needed.")
46
- except pkg_resources.DistributionNotFound:
47
- print("numpy is not installed. Installing numpy<2.0.0...")
48
- subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy<2.0.0"])
49
 
50
 
51
  from huggingface_hub import login
 
21
  import sys
22
  import pkg_resources
23
 
24
+ # try:
25
+ # subprocess.check_call([sys.executable, "-m", "pip", "install", "mattersim"])
26
+ # except Exception as e:
27
+ # print(f"Error during installation of mattersim: {e}")
28
 
29
+ # try:
30
+ # from mattersim.forcefield import MatterSimCalculator
31
+ # mattersim_available = True
32
+ # print("\n\n\n\n\n\n\nSuccessfully imported MatterSimCalculator.\n\n\n\n\n\n\n\n\n\n")
33
+ # except ImportError as e:
34
+ # print(f"Failed to import MatterSimCalculator: {e} \n\n\n\n\n\n\n\n")
35
+ # mattersim_available = False
36
+ # # Define version threshold
37
+ # required_version = "2.0.0"
38
 
39
+ # try:
40
+ # installed_version = pkg_resources.get_distribution("numpy").version
41
+ # if pkg_resources.parse_version(installed_version) >= pkg_resources.parse_version(required_version):
42
+ # print(f"numpy version {installed_version} >= {required_version}. Installing numpy<2.0.0...")
43
+ # subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy<2.0.0"])
44
+ # else:
45
+ # print(f"numpy version {installed_version} is already < {required_version}. No action needed.")
46
+ # except pkg_resources.DistributionNotFound:
47
+ # print("numpy is not installed. Installing numpy<2.0.0...")
48
+ # subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy<2.0.0"])
49
 
50
 
51
  from huggingface_hub import login