Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,10 +10,10 @@ from statistics import mean
|
|
| 10 |
HFTOKEN = os.environ["HF_TOKEN"]
|
| 11 |
|
| 12 |
def load_and_classify_csv(file, text_field, event_model):
|
| 13 |
-
if ".csv" in file.name:
|
| 14 |
-
|
| 15 |
-
else ".tsv" in file.name:
|
| 16 |
-
|
| 17 |
|
| 18 |
if text_field not in df.columns:
|
| 19 |
raise gr.Error(f"Error: Enter text column'{text_field}' not in CSV file.")
|
|
|
|
| 10 |
HFTOKEN = os.environ["HF_TOKEN"]
|
| 11 |
|
| 12 |
def load_and_classify_csv(file, text_field, event_model):
|
| 13 |
+
# if ".csv" in file.name:
|
| 14 |
+
# df = pd.read_csv(file.name)
|
| 15 |
+
# else ".tsv" in file.name:
|
| 16 |
+
df = pd.read_table(file.name)
|
| 17 |
|
| 18 |
if text_field not in df.columns:
|
| 19 |
raise gr.Error(f"Error: Enter text column'{text_field}' not in CSV file.")
|