Spaces:
Runtime error
Runtime error
Commit ·
89f56ab
1
Parent(s): 3a0459e
Update app.py
Browse files11 unmodified lines12131415161718192021222324252627282930313233343536373811 unmodified linesimport pandas as pdfrom pycaret.regression import *GE = pd.read_csv('https://github.com/GEProject/GEProject/blob/main/Combined_Vars.csv')setup = setup(data = GE, target ='rul', session_id = 1)ada_model = create_model('ada')tuned_ada = tune_model(ada_model)# GE_url = 'https://github.com/GEProject/GEProject/blob/main/Combined_Vars.csv'#download = requests.get(GE_url).content#GE_data =pd.read_csv(io.StringIO(download.decode('utf-8')))#GE_data = GE_data.to_numpy()#GE_data = GE_data.tolist()def predict(dist, flight_cycle, t50_max, nc_avg, ps30_max, nrc_max, bpr_max, w32_avg):# with urllib.request.urlopen('https://github.com/GEProject/GEProject/blob/main/final_model.pkl?raw=true') as response, open('final_model.pkl', 'wb') as out_file:# shutil.copyfileobj(response, out_file)pred = predict_model(tuned_ada)return {'RUL': pred['Label']}11 unmodified lines121314151617181920212223242526272829303111 unmodified linesimport pandas as pdfrom pycaret.regression import *GE_url = 'https://github.com/GEProject/GEProject/blob/main/Combined_Vars.csv'download = requests.get(GE_url).contentGE_data =pd.read_csv(io.StringIO(download.decode('utf-8')))GE_data = GE_data.to_numpy()GE_data = GE_data.tolist()def predict(dist, flight_cycle, t50_max, nc_avg, ps30_max, nrc_max, bpr_max, w32_avg):with urllib.request.urlopen('https://github.com/GEProject/GEProject/blob/main/final_model.pkl?raw=true') as response, open('final_model.pkl', 'wb') as out_file:shutil.copyfileobj(response, out_file)pred = predict_model(tuned_ada)return {'RUL': pred['Label']}
app.py+7-14