add
Browse files
app.py
CHANGED
@@ -139,7 +139,7 @@ async def generate_text(file: UploadFile = File(...)):
|
|
139 |
# Read the uploaded CSV file
|
140 |
try:
|
141 |
contents = await file.read()
|
142 |
-
df = pd.read_csv(
|
143 |
except Exception as e:
|
144 |
return {"error": f"Error reading CSV file: {str(e)}"}
|
145 |
|
|
|
139 |
# Read the uploaded CSV file
|
140 |
try:
|
141 |
contents = await file.read()
|
142 |
+
df = pd.read_csv(StringIO(contents.decode('utf-8')))
|
143 |
except Exception as e:
|
144 |
return {"error": f"Error reading CSV file: {str(e)}"}
|
145 |
|