drakosfire's picture
Reorganized the project into a module called document processing, and execute through a single entry file pdf_to_embeddings.py
824bd32
raw
history blame contribute delete
510 Bytes
import os
import logging
def get_file_name_without_ext(file_path):
try:
if not file_path: # Check for empty string
return None
# Extract the base name from the file path
base_name = os.path.basename(file_path)
# Remove the file extension
file_name_without_ext = os.path.splitext(base_name)[0]
return file_name_without_ext
except (TypeError, AttributeError) as e:
logging.error(f"Error processing file path: {e}")
return None