Skip to content

Commit

Permalink
version control
Browse files Browse the repository at this point in the history
  • Loading branch information
astorfi committed Nov 23, 2024
1 parent c38994a commit 4221356
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 14 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,30 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9' # Updated to 3.9
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
pip install "black[jupyter]" # Install Jupyter support for Black
pip install "black[jupyter]"
- name: Run Black
- name: Run Isort to Auto-Fix Imports
run: |
isort . --skip-glob "*.ipynb" # Automatically fix import order for all files except Jupyter notebooks
- name: Run Isort Check
run: |
black . --exclude "\.ipynb$" # Skip Jupyter notebook files
isort --check-only . --skip-glob "*.ipynb" # Verify that all imports are correctly sorted
- name: Run isort
- name: Run Black
run: |
isort --check-only . --skip-glob "*.ipynb" # Skip Jupyter notebook files
black . --exclude "\.ipynb$"
- name: Run Pylint
run: |
pylint src tests --ignore-patterns=".*\.ipynb$" # Skip Jupyter notebook files
pylint src tests --ignore-patterns=".*\.ipynb$"
- name: Run tests with coverage
run: |
Expand Down
9 changes: 5 additions & 4 deletions src/data/data_augmentation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import requests
import logging
import random
import spacy

import backoff
import nltk
import requests
import spacy
from nltk.corpus import wordnet
import backoff
import logging

# Load Spacy model for NER and tokenization
nlp = spacy.load("en_core_web_sm")
Expand Down
1 change: 1 addition & 0 deletions src/evaluation/contextual_metrics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from bert_score import score


class ContextualMetrics:
@staticmethod
def bleu(reference, candidate):
Expand Down
3 changes: 2 additions & 1 deletion src/preprocessing/augmentation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import random
import re
import spacy

import nltk
import spacy
from nltk.corpus import stopwords
from spellchecker import SpellChecker

Expand Down
4 changes: 3 additions & 1 deletion src/preprocessing/cleaning.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pandas as pd
import re

import pandas as pd


class DataCleaning:
def __init__(self, df):
self.df = df
Expand Down
1 change: 1 addition & 0 deletions src/preprocessing/curriculum_learning.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pandas as pd


class CurriculumLearning:
def __init__(self, df):
self.df = df
Expand Down
1 change: 1 addition & 0 deletions src/reinforcement/multi_objective_rl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np


class MultiObjectiveRL:
def __init__(self, reward_weights):
self.reward_weights = reward_weights
Expand Down
3 changes: 2 additions & 1 deletion src/training/distributed_rl.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import torch.distributed as dist


class DistributedTraining:
def __init__(self, model, dataset):
Expand Down
1 change: 1 addition & 0 deletions src/training/ppo_hyperparameter_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from ray import tune
from ray.rllib.agents.ppo import PPOTrainer


def ppo_training(config):
trainer = PPOTrainer(config=config)
for i in range(50):
Expand Down

0 comments on commit 4221356

Please sign in to comment.