Spaces:
Paused
Paused
Update app.py
Browse files40 unmodified lines414243444546474840 unmodified linestry:logger.info("Starting text processing...")# Read the text directly from the uploaded filetext = file # The file content is already a stringlogger.info(f"Text length: {len(text)} characters.")# Segment the text into chunks40 unmodified lines414243444546474849505152535440 unmodified linestry:logger.info("Starting text processing...")# Read the file content properlyif hasattr(file, "read"):# If the file is a file-like object, read its contenttext = file.read().decode('utf-8') # Decode bytes to stringelse:# If the file is already a string, use it directlytext = filelogger.info(f"Text length: {len(text)} characters.")# Segment the text into chunks
app.py+8-2