Skip to content

Latest commit

 

History

History
84 lines (54 loc) · 2.1 KB

File metadata and controls

84 lines (54 loc) · 2.1 KB

Exams RAG

Pre-processing

Exams Loader

The exams_loader.py file is used to retrieve the exams and the syllabus for a specific subject. To run this module, use the following command

(.venv) $> python -m src/loaders/exams_loader.py --subject_dir={subject_dir}

where {subject_dir} is the directory where the exams and syllabus are located with the following structure:

{subject_dir}
├── exams
│   ├── {subject}-{ISO Date}.pdf
│   ├── ...
└── syllabus.txt

Run the application

To run the application, run the following command:

(.venv) $> python -m src.local

You can modify the exam and format inside the file.

FAQ

How do I create a local environment?

In order to make sure we use the correct dependencies locally, we'll need to set up the environment. To do that, run the following command:

$> python3 -m venv .venv

How do I use the environment?

To use the created environment, you'll need to run the following command:

$> source .venv/bin/activate

How do I install the dependencies on my local environment?

After using the environment with the source command, you'll need to install the dependencies with the following command:

(.venv) $> pip install -r requirements.txt

How do I run the different modules?

In order to run the different python modules, you'll need to do the following steps:

  1. Make sure that module has an __init__.py file inside of it. This file can be empty.
  2. Run the file with the -m flag.

Here's an example:

  1. The module I'd like to create is located at src/repositories, so I'd create an __init__.py file running something like this:
$> touch src/repositories/__init__.py
  1. Imagine we have a Python file called testing_repository.py inside the src/repositories directory. Then, we'd run the following command:
(.venv) $> python -m src.repositories.testing_repository

How do I build for deployment?

Use docker build -t exams-generator ., tag the image and then push to ECR. After that, deploy a new image on the API lambda function.