Update app/main.py
Browse files- app/main.py +7 -4
app/main.py
CHANGED
@@ -31,10 +31,13 @@ def home():
|
|
31 |
|
32 |
@app.post("/upload/")
|
33 |
def upload_csv(file:UploadFile=File(...)):
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
38 |
|
39 |
@app.post("/train/")
|
40 |
def training():
|
|
|
31 |
|
32 |
@app.post("/upload/")
|
33 |
def upload_csv(file:UploadFile=File(...)):
|
34 |
+
try:
|
35 |
+
global dataset
|
36 |
+
dataset=pd.read_csv(file.file)
|
37 |
+
file.file.close()
|
38 |
+
return {"filename": file.filename}
|
39 |
+
else:
|
40 |
+
return {"message":"Pleae upload a CSV file"}
|
41 |
|
42 |
@app.post("/train/")
|
43 |
def training():
|