Spaces:
Sleeping
Sleeping
update interface
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def classify_comments():
|
|
| 38 |
|
| 39 |
# Gradio Interface
|
| 40 |
with gr.Blocks() as nps:
|
| 41 |
-
uploaded_file = gr.File(label="Upload CSV", type="
|
| 42 |
template_btn = gr.Button("Use Template")
|
| 43 |
gr.Markdown("# NPS Comment Categorization")
|
| 44 |
classify_btn = gr.Button("Classify Comments")
|
|
@@ -50,7 +50,7 @@ with gr.Blocks() as nps:
|
|
| 50 |
import io
|
| 51 |
if file.name.endswith('.csv'):
|
| 52 |
file.seek(0) # Reset file pointer
|
| 53 |
-
custom_df = pd.read_csv(file)
|
| 54 |
custom_df = pd.read_csv(io.StringIO(content))
|
| 55 |
else:
|
| 56 |
return "Error: Uploaded file is not a CSV."
|
|
|
|
| 38 |
|
| 39 |
# Gradio Interface
|
| 40 |
with gr.Blocks() as nps:
|
| 41 |
+
uploaded_file = gr.File(label="Upload CSV", type="filepath")
|
| 42 |
template_btn = gr.Button("Use Template")
|
| 43 |
gr.Markdown("# NPS Comment Categorization")
|
| 44 |
classify_btn = gr.Button("Classify Comments")
|
|
|
|
| 50 |
import io
|
| 51 |
if file.name.endswith('.csv'):
|
| 52 |
file.seek(0) # Reset file pointer
|
| 53 |
+
custom_df = pd.read_csv(file, encoding='utf-8')
|
| 54 |
custom_df = pd.read_csv(io.StringIO(content))
|
| 55 |
else:
|
| 56 |
return "Error: Uploaded file is not a CSV."
|