diff --git a/processors/machine_learning/annotate_text.py b/processors/machine_learning/annotate_text.py index f8611ba7..be69540a 100644 --- a/processors/machine_learning/annotate_text.py +++ b/processors/machine_learning/annotate_text.py @@ -312,7 +312,7 @@ def validate_query(query, request, user): wrapped_file = io.TextIOWrapper(file, encoding=encoding) try: wrapped_file.seek(0) - dialect, has_header = sniff_csv_dialect(file) + dialect, has_header = sniff_csv_dialect(wrapped_file) reader = csv.reader(wrapped_file, dialect=dialect) if not has_header else csv.DictReader(wrapped_file) row = next(reader) if len(list(row)) != 2: