Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -29,7 +29,7 @@ app.add_middleware(
|
|
29 |
def train_the_model(data,page):
|
30 |
if str(page) == "2":
|
31 |
|
32 |
-
new_data =
|
33 |
encoders = load('transexpress_encoders.joblib')
|
34 |
xgb_model = load('transexpress_xgb_model.joblib')
|
35 |
|
@@ -150,6 +150,14 @@ def train_the_model(data,page):
|
|
150 |
|
151 |
@app.get("/trigger_the_data_fecher")
|
152 |
async def your_continuous_function(page: str,paginate: str):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
print("data fetcher running.....")
|
154 |
|
155 |
# Initialize an empty DataFrame to store the combined data
|
|
|
29 |
def train_the_model(data,page):
|
30 |
if str(page) == "2":
|
31 |
|
32 |
+
new_data = data
|
33 |
encoders = load('transexpress_encoders.joblib')
|
34 |
xgb_model = load('transexpress_xgb_model.joblib')
|
35 |
|
|
|
150 |
|
151 |
@app.get("/trigger_the_data_fecher")
|
152 |
async def your_continuous_function(page: str,paginate: str):
|
153 |
+
|
154 |
+
if str(page) == "2":
|
155 |
+
df = pd.read_csv("transexpress_v10.csv")
|
156 |
+
print("file readed")
|
157 |
+
accuracy,classification_rep,message = train_the_model(df,page)
|
158 |
+
|
159 |
+
return {"message":message,"page_number":page,"data_count":data_count,"accuracy":accuracy,"classification_rep":classification_rep}
|
160 |
+
|
161 |
print("data fetcher running.....")
|
162 |
|
163 |
# Initialize an empty DataFrame to store the combined data
|