Spaces:
Paused
Paused
Update app.py
Browse files1 unmodified line234567832 unmodified lines414243444546471 unmodified linefrom gradio_client import Clientfrom huggingface_hub import HfApiimport loggingimport time # Import time module for adding delays# Set up logginglogging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")32 unmodified lineslogger.info("Starting text processing...")# Read the text directly from the uploaded filetext = file.decode('utf-8') # Assuming the file is encoded in UTF-8# Segment the text into chunkschunks = segment_text(text)1 unmodified line2345678932 unmodified lines42434445464748491 unmodified linefrom gradio_client import Clientfrom huggingface_hub import HfApiimport loggingimport timeimport os# Set up logginglogging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")32 unmodified lineslogger.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 chunkschunks = segment_text(text)
app.py+4-2