Spaces:
Runtime error
Runtime error
Update app/main.py
Browse files- app/main.py +5 -8
app/main.py
CHANGED
|
@@ -31,14 +31,11 @@ def home():
|
|
| 31 |
|
| 32 |
@app.post("/upload/")
|
| 33 |
def upload_csv(file:UploadFile=File(...)):
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
except:
|
| 40 |
-
return {"message":"Pleae upload a CSV file"}
|
| 41 |
-
|
| 42 |
@app.post("/train/")
|
| 43 |
def training():
|
| 44 |
if dataset is not None:
|
|
|
|
| 31 |
|
| 32 |
@app.post("/upload/")
|
| 33 |
def upload_csv(file:UploadFile=File(...)):
|
| 34 |
+
global dataset
|
| 35 |
+
dataset=pd.read_csv(file.file)
|
| 36 |
+
file.file.close()
|
| 37 |
+
return {"filename": file.filename}
|
| 38 |
+
|
|
|
|
|
|
|
|
|
|
| 39 |
@app.post("/train/")
|
| 40 |
def training():
|
| 41 |
if dataset is not None:
|