Spaces:
Runtime error
Runtime error
| # from classes.rag_application import RAGApplication | |
| # from classes.pdf_extractor import PDFExtractor | |
| # from classes.generative_model import GenerativeModel, GenerativeModelConfig | |
| # from utils import initialize_logger, read_config | |
| # from pathlib import Path | |
| # import logging | |
| # | |
| # logging.basicConfig(level=logging.INFO) | |
| # logger = logging.getLogger(__name__) | |
| # | |
| # logger = initialize_logger() | |
| # | |
| # # Initialize required components from config | |
| # config = read_config("conf/config.yaml") | |
| # pdf_extractor = PDFExtractor(config["pdf_extractor"]) | |
| # vector_db = VectorDatabase(config["vector_database"]) | |
| # | |
| # # Get PDF path from config | |
| # pdf_path = config["data"]["input_data_path"] | |
| # | |
| # def run(config: dict): | |
| # """ | |
| # Run the RAG application. | |
| # :param config: Configuration dictionary | |
| # """ | |
| # logger.info("Create generative model") | |
| # generative_model_config = GenerativeModelConfig(model_name=config['generative_model']['model_name']) | |
| # generative_model = GenerativeModel(generative_model_config) | |
| # | |
| # logger.info("Create RAG application") | |
| # rag_app = RAGApplication(vector_db, pdf_extractor, generative_model) | |
| # rag_app.run(pdf_path, 'Give me a summary of the document') | |
| # logger.info("RAG application completed") | |
| # | |
| # if __name__ == '__main__': | |
| # run(config) | |