Spaces:
Running
on
Zero
Running
on
Zero
reset file pointer
Browse files
app.py
CHANGED
@@ -46,7 +46,8 @@ with gr.Blocks() as nps:
|
|
46 |
|
47 |
def load_data(file):
|
48 |
if file is not None:
|
49 |
-
|
|
|
50 |
if 'customer_comment' not in custom_df.columns:
|
51 |
return "Error: Uploaded CSV must contain a column named 'customer_comment'"
|
52 |
global df
|
|
|
46 |
|
47 |
def load_data(file):
|
48 |
if file is not None:
|
49 |
+
file.seek(0) # Reset file pointer
|
50 |
+
custom_df = pd.read_csv(file)
|
51 |
if 'customer_comment' not in custom_df.columns:
|
52 |
return "Error: Uploaded CSV must contain a column named 'customer_comment'"
|
53 |
global df
|