Skip to content

Commit

Permalink
Merge pull request #152 from mit-submit/hotfix/lowercase-a2rchi
Browse files Browse the repository at this point in the history
Hotfix/lowercase a2rchi
  • Loading branch information
mdr223 authored Nov 18, 2023
2 parents 67db575 + bd52c86 commit d7720e2
Show file tree
Hide file tree
Showing 60 changed files with 82 additions and 82 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions A2rchi/bin/service_chat.py → a2rchi/bin/service_chat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/python
from A2rchi.interfaces.chat_app.app import FlaskAppWrapper
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.env import read_secret
from a2rchi.interfaces.chat_app.app import FlaskAppWrapper
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.env import read_secret

from flask import Flask

Expand Down
6 changes: 3 additions & 3 deletions A2rchi/bin/service_cleo.py → a2rchi/bin/service_cleo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/python
from A2rchi.interfaces import cleo
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.env import read_secret
from a2rchi.interfaces import cleo
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.env import read_secret

import os
import time
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/python
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.env import read_secret
from A2rchi.interfaces.uploader_app.app import add_username_password
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.env import read_secret
from a2rchi.interfaces.uploader_app.app import add_username_password

import getpass
import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/python
from A2rchi.interfaces import cleo
from A2rchi.utils import mailbox
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.env import read_secret
from a2rchi.interfaces import cleo
from a2rchi.utils import mailbox
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.env import read_secret

import os
import time
Expand Down
12 changes: 6 additions & 6 deletions A2rchi/bin/service_piazza.py → a2rchi/bin/service_piazza.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/python
from A2rchi.chains.chain import Chain
from A2rchi.interfaces.uploader_app.app import FlaskAppWrapper
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.data_manager import DataManager
from A2rchi.utils.env import read_secret
from A2rchi.utils.scraper import Scraper
from a2rchi.chains.chain import Chain
from a2rchi.interfaces.uploader_app.app import FlaskAppWrapper
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.data_manager import DataManager
from a2rchi.utils.env import read_secret
from a2rchi.utils.scraper import Scraper

from flask import Flask
from piazza_api import Piazza
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/python
from A2rchi.interfaces.uploader_app.app import FlaskAppWrapper
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.data_manager import DataManager
from A2rchi.utils.env import read_secret
from A2rchi.utils.scraper import Scraper
from a2rchi.interfaces.uploader_app.app import FlaskAppWrapper
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.data_manager import DataManager
from a2rchi.utils.env import read_secret
from a2rchi.utils.scraper import Scraper

from flask import Flask
from threading import Thread
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions A2rchi/chains/base.py → a2rchi/chains/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from loguru import logger
from langchain.callbacks import FileCallbackHandler

from A2rchi.chains.prompts import CONDENSE_QUESTION_PROMPT, QA_PROMPT
from A2rchi.utils.config_loader import Config_Loader
from a2rchi.chains.prompts import CONDENSE_QUESTION_PROMPT, QA_PROMPT
from a2rchi.utils.config_loader import Config_Loader

from langchain.base_language import BaseLanguageModel
from langchain.chains.combine_documents.stuff import StuffDocumentsChain
Expand Down
4 changes: 2 additions & 2 deletions A2rchi/chains/chain.py → a2rchi/chains/chain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from A2rchi.chains.base import BaseSubMITChain as BaseChain
from a2rchi.chains.base import BaseSubMITChain as BaseChain

from chromadb.config import Settings
from langchain.vectorstores import Chroma
Expand All @@ -17,7 +17,7 @@ def __init__(self):
"""
self.kill = False

from A2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.config_loader import Config_Loader
self.config = Config_Loader().config["chains"]["chain"]
self.global_config = Config_Loader().config["global"]
self.utils_config = Config_Loader().config["utils"]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion A2rchi/chains/prompts.py → a2rchi/chains/prompts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flake8: noqa
from langchain.prompts.prompt import PromptTemplate
from A2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.config_loader import Config_Loader

config = Config_Loader().config["chains"]["prompts"]

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from A2rchi.chains.chain import Chain
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.data_manager import DataManager
from A2rchi.utils.env import read_secret
from A2rchi.utils.sql import SQL_INSERT_CONVO, SQL_INSERT_FEEDBACK, SQL_INSERT_TIMING, SQL_QUERY_CONVO
from a2rchi.chains.chain import Chain
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.data_manager import DataManager
from a2rchi.utils.env import read_secret
from a2rchi.utils.sql import SQL_INSERT_CONVO, SQL_INSERT_FEEDBACK, SQL_INSERT_TIMING, SQL_QUERY_CONVO

from datetime import datetime
from pygments import highlight
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions A2rchi/interfaces/cleo.py → a2rchi/interfaces/cleo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from A2rchi.chains.chain import Chain
from A2rchi.utils import sender
from A2rchi.utils.data_manager import DataManager
from A2rchi.utils.env import read_secret
from a2rchi.chains.chain import Chain
from a2rchi.utils import sender
from a2rchi.utils.data_manager import DataManager
from a2rchi.utils.env import read_secret

from redminelib import Redmine

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.env import read_secret
from A2rchi.utils.scraper import Scraper
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.env import read_secret
from a2rchi.utils.scraper import Scraper

from flask import render_template, request, redirect, url_for, flash, session

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from A2rchi.chains.models import OpenAILLM, DumbLLM, LlamaLLM
from a2rchi.chains.models import OpenAILLM, DumbLLM, LlamaLLM

from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.embeddings import HuggingFaceEmbeddings
Expand Down
4 changes: 2 additions & 2 deletions A2rchi/utils/data_manager.py → a2rchi/utils/data_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from A2rchi.utils.scraper import Scraper
from a2rchi.utils.scraper import Scraper

from chromadb.config import Settings
from langchain.document_loaders import TextLoader
Expand All @@ -19,7 +19,7 @@
class DataManager():

def __init__(self):
from A2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.config_loader import Config_Loader
self.config = Config_Loader().config["utils"]
self.global_config = Config_Loader().config["global"]
self.data_path = self.global_config["DATA_PATH"]
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion A2rchi/utils/imap.py → a2rchi/utils/imap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import getpass, imaplib, email

from A2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.config_loader import Config_Loader
config = Config_Loader().config["utils"]["mailbox"]

def get_charsets(msg):
Expand Down
4 changes: 2 additions & 2 deletions A2rchi/utils/mailbox.py → a2rchi/utils/mailbox.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/python
from A2rchi.utils.config_loader import Config_Loader
from A2rchi.utils.env import read_secret
from a2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.env import read_secret

import email
import imaplib
Expand Down
2 changes: 1 addition & 1 deletion A2rchi/utils/scraper.py → a2rchi/utils/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Scraper():

def __init__(self, piazza_email=None, piazza_password=None):
# fetch configs
from A2rchi.utils.config_loader import Config_Loader
from a2rchi.utils.config_loader import Config_Loader
self.config = Config_Loader().config["utils"]["scraper"]
self.global_config = Config_Loader().config["global"]
self.piazza_config = Config_Loader().config["utils"].get("piazza", None)
Expand Down
2 changes: 1 addition & 1 deletion A2rchi/utils/sender.py → a2rchi/utils/sender.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from A2rchi.utils.env import read_secret
from a2rchi.utils.env import read_secret

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions config/dev-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interfaces:
EXTERNAL_PORT: 7682
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
HOSTNAME: "submit06.mit.edu" # careful, this is used for the chat service
template_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/static"
template_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/static"
num_responses_until_feedback: 3 #the number of responses given by A2rchi until she asks for feedback.
include_copy_button: False
uploader_app:
PORT: 5001
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
template_folder: "/root/A2rchi/A2rchi/interfaces/uploader_app/templates"
template_folder: "/root/A2rchi/a2rchi/interfaces/uploader_app/templates"

chains:
input_lists:
Expand Down
6 changes: 3 additions & 3 deletions config/prod-801-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interfaces:
EXTERNAL_PORT: 7683
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
HOSTNAME: "t3desk019.mit.edu" # careful, this is used for the chat service
template_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/static"
template_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/static"
num_responses_until_feedback: 3 #the number of responses given by A2rchi until she asks for feedback.
include_copy_button: False
uploader_app:
PORT: 5001
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
template_folder: "/root/A2rchi/A2rchi/interfaces/uploader_app/templates"
template_folder: "/root/A2rchi/a2rchi/interfaces/uploader_app/templates"

chains:
input_lists:
Expand Down
6 changes: 3 additions & 3 deletions config/prod-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interfaces:
EXTERNAL_PORT: 7681
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
HOSTNAME: "t3desk019.mit.edu" # careful, this is used for the chat service
template_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/static"
template_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/static"
num_responses_until_feedback: 3 #the number of responses given by A2rchi until she asks for feedback.
include_copy_button: False
uploader_app:
PORT: 5001
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
template_folder: "/root/A2rchi/A2rchi/interfaces/uploader_app/templates"
template_folder: "/root/A2rchi/a2rchi/interfaces/uploader_app/templates"

chains:
input_lists:
Expand Down
6 changes: 3 additions & 3 deletions config/prod-meta-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interfaces:
EXTERNAL_PORT: 7685
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
HOSTNAME: "submit06.mit.edu" # careful, this is used for the chat service
template_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/static"
template_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/static"
num_responses_until_feedback: 3 #the number of responses given by A2rchi until she asks for feedback.
include_copy_button: False
uploader_app:
PORT: 5001
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
template_folder: "/root/A2rchi/A2rchi/interfaces/uploader_app/templates"
template_folder: "/root/A2rchi/a2rchi/interfaces/uploader_app/templates"

chains:
input_lists:
Expand Down
6 changes: 3 additions & 3 deletions config/prod-root-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interfaces:
EXTERNAL_PORT: 7684
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
HOSTNAME: "submit06.mit.edu" # careful, this is used for the chat service
template_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/A2rchi/interfaces/chat_app/static"
template_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/templates"
static_folder: "/root/A2rchi/a2rchi/interfaces/chat_app/static"
num_responses_until_feedback: 3 #the number of responses given by A2rchi until she asks for feedback.
include_copy_button: False
uploader_app:
PORT: 5001
HOST: "0.0.0.0" # either "0.0.0.0" (for public) or "127.0.0.1" (for internal)
template_folder: "/root/A2rchi/A2rchi/interfaces/uploader_app/templates"
template_folder: "/root/A2rchi/a2rchi/interfaces/uploader_app/templates"

chains:
input_lists:
Expand Down
2 changes: 1 addition & 1 deletion deploy/dockerfiles/Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ COPY pyproject.toml pyproject.toml
COPY README.md README.md
COPY LICENSE LICENSE
COPY config config
COPY A2rchi A2rchi
COPY a2rchi a2rchi
RUN pip install --upgrade pip && pip install .
2 changes: 1 addition & 1 deletion deploy/dockerfiles/Dockerfile-chat
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ EXPOSE 7861
# ensure this directory is present for prod-801 deployment
RUN if [ "$BUILD_ENV" = "prod-801" ] ; then mkdir /root/data/801-content ; fi

CMD ["python", "-u", "A2rchi/bin/service_chat.py"]
CMD ["python", "-u", "a2rchi/bin/service_chat.py"]
2 changes: 1 addition & 1 deletion deploy/dockerfiles/Dockerfile-cleo
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ARG TAG=from-env
FROM a2rchi-base:${TAG}

CMD ["python", "-u", "A2rchi/bin/service_cleo.py"]
CMD ["python", "-u", "a2rchi/bin/service_cleo.py"]
2 changes: 1 addition & 1 deletion deploy/dockerfiles/Dockerfile-mailbox
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ARG TAG=from-env
FROM a2rchi-base:${TAG}

CMD ["python", "-u", "A2rchi/bin/service_mailbox.py"]
CMD ["python", "-u", "a2rchi/bin/service_mailbox.py"]
2 changes: 1 addition & 1 deletion deploy/dockerfiles/Dockerfile-piazza
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ARG TAG=from-env
FROM a2rchi-base:${TAG}

CMD ["python", "-u", "A2rchi/bin/service_piazza.py"]
CMD ["python", "-u", "a2rchi/bin/service_piazza.py"]
2 changes: 1 addition & 1 deletion deploy/dockerfiles/Dockerfile-uploader
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ARG TAG=from-env
FROM a2rchi-base:${TAG}

CMD ["python", "-u", "A2rchi/bin/service_uploader.py"]
CMD ["python", "-u", "a2rchi/bin/service_uploader.py"]
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "A2rchi"
name = "a2rchi"
version = "0.1.0"
description = "An AI Augmented Research Chat Intelligence (A2rchi)"
requires-python = ">=3.7"
Expand Down Expand Up @@ -62,13 +62,13 @@ dependencies = [

[tool.setuptools]
packages = [
"A2rchi",
"A2rchi.bin",
"A2rchi.chains",
"A2rchi.interfaces",
"A2rchi.interfaces.chat_app",
"A2rchi.interfaces.uploader_app",
"A2rchi.utils",
"a2rchi",
"a2rchi.bin",
"a2rchi.chains",
"a2rchi.interfaces",
"a2rchi.interfaces.chat_app",
"a2rchi.interfaces.uploader_app",
"a2rchi.utils",
]

[build-system]
Expand Down
6 changes: 3 additions & 3 deletions test/test_chains.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from A2rchi.chains.chain import Chain
from A2rchi.chains.models import DumbLLM, LlamaLLM, OpenAILLM
from A2rchi.utils.config_loader import Config_Loader
from a2rchi.chains.chain import Chain
from a2rchi.chains.models import DumbLLM, LlamaLLM, OpenAILLM
from a2rchi.utils.config_loader import Config_Loader

from langchain.schema import AIMessage, HumanMessage, SystemMessage

Expand Down
2 changes: 1 addition & 1 deletion test/test_interfaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from A2rchi.interfaces.cleo import Cleo
from a2rchi.interfaces.cleo import Cleo

from time import time
import threading
Expand Down

0 comments on commit d7720e2

Please sign in to comment.