Harshil24 commited on
Commit
34d896b
·
1 Parent(s): 51481bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -133,14 +133,28 @@ def changedatashape():
133
  os.remove('sample.csv')
134
 
135
 
136
- command = "java --enable-preview -jar /jadbio-model-exe.jar \
137
- -m /jadbio-1.4.119-model-Augustwithprice_feature0.bin \
138
- -i /content/sample2.csv \
139
- -o predictions.csv"
 
 
 
 
 
 
 
 
140
 
141
  def generate_result():
142
- subprocess.run(command)
143
 
 
 
 
 
 
 
 
144
 
145
 
146
  def predict(m,historical=True):
 
133
  os.remove('sample.csv')
134
 
135
 
136
+ command = [
137
+ '/path/to/java',
138
+ '--enable-preview',
139
+ '-jar',
140
+ '/jadbio-model-exe.jar',
141
+ '-m',
142
+ '/jadbio-1.4.119-model-Augustwithprice_feature0.bin',
143
+ '-i',
144
+ '/sample2.csv',
145
+ '-o',
146
+ '/predictions.csv'
147
+ ]
148
 
149
  def generate_result():
 
150
 
151
+ try:
152
+ subprocess.run(command)
153
+ except subprocess.CalledProcessError as e:
154
+ print(f"Command execution failed with error code {e.returncode}: {e.stderr}")
155
+ except Exception as e:
156
+ print(f"An unexpected error occurred: {str(e)}")
157
+
158
 
159
 
160
  def predict(m,historical=True):