diff --git a/A2rchi/chains/models.py b/A2rchi/chains/models.py index f8af0213..76564bc5 100644 --- a/A2rchi/chains/models.py +++ b/A2rchi/chains/models.py @@ -2,6 +2,7 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Union import numpy as np import torch +import time from langchain.callbacks.manager import CallbackManagerForLLMRun from langchain.llms.base import LLM @@ -32,6 +33,7 @@ class DumbLLM(BaseCustomLLM): A simple Dumb LLM, perfect for testing """ filler: str = None + sleep_time_mean: int = 3 def _call( self, @@ -39,6 +41,9 @@ def _call( stop: Optional[List[str]] = None, run_manager: Optional[CallbackManagerForLLMRun] = None, ) -> str: + sleep_time = np.random.normal(self.sleep_time_mean, 1) + print(f"DumbLLM: sleeping {sleep_time}") + time.sleep(sleep_time) return "I am just a dumb LLM, I will give you a number: " + str(np.random.randint(10000, 99999)) class LlamaLLM(BaseCustomLLM): diff --git a/config/801-textbook.list b/config/801-textbook.list index a830ee00..00c96111 100644 --- a/config/801-textbook.list +++ b/config/801-textbook.list @@ -1,20 +1,20 @@ # websites to 8.01 texbook -https://mit-teal.github.io/801/textbook/chapter01.pdf -https://mit-teal.github.io/801/textbook/chapter02.pdf -https://mit-teal.github.io/801/textbook/chapter03.pdf -https://mit-teal.github.io/801/textbook/chapter04.pdf -https://mit-teal.github.io/801/textbook/chapter05.pdf -https://mit-teal.github.io/801/textbook/chapter06.pdf -https://mit-teal.github.io/801/textbook/chapter07.pdf -https://mit-teal.github.io/801/textbook/chapter08.pdf -https://mit-teal.github.io/801/textbook/chapter09.pdf -https://mit-teal.github.io/801/textbook/chapter10.pdf -https://mit-teal.github.io/801/textbook/chapter11.pdf -https://mit-teal.github.io/801/textbook/chapter12.pdf -https://mit-teal.github.io/801/textbook/chapter13.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter01.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter02.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter03.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter04.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter05.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter06.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter07.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter08.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter09.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter10.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter11.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter12.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter13.pdf https://mit-teal.github.io/801/textbook/chapter14.pdf https://mit-teal.github.io/801/textbook/chapter15.pdf -https://mit-teal.github.io/801/textbook/chapter16.pdf +https://mit-teal.github.io/801/textbook/2ed_chapter16.pdf https://mit-teal.github.io/801/textbook/chapter17.pdf https://mit-teal.github.io/801/textbook/chapter18.pdf https://mit-teal.github.io/801/textbook/chapter19.pdf @@ -29,4 +29,4 @@ https://mit-teal.github.io/801/textbook/chapter27.pdf https://mit-teal.github.io/801/textbook/chapter28.pdf https://mit-teal.github.io/801/textbook/chapter29.pdf https://mit-teal.github.io/801/textbook/chapter30.pdf -https://mit-teal.github.io/801/textbook/chapter31.pdf \ No newline at end of file +https://mit-teal.github.io/801/textbook/chapter31.pdf diff --git a/config/dev-config.yaml b/config/dev-config.yaml index 31b594b3..404403e2 100644 --- a/config/dev-config.yaml +++ b/config/dev-config.yaml @@ -44,17 +44,18 @@ chains: MAIN_PROMPT: config/prompts/submit.prompt chain: # pick one of the models listed in the model class map below - MODEL_NAME: OpenAILLM # LlamaLLM + MODEL_NAME: DumbLLM # LlamaLLM # map of all the class models and their keyword arguments MODEL_CLASS_MAP: OpenAILLM: class: OpenAILLM kwargs: - model_name: gpt-4 + model_name: gpt-4 #or gpt-3.5-turbo temperature: 1 DumbLLM: class: DumbLLM - kwargs: + kwargs: + sleep_time_mean: 3 filler: null LlamaLLM: class: LlamaLLM diff --git a/config/prod-root-config.yaml b/config/prod-root-config.yaml index f7e32cf2..1d8ffd30 100644 --- a/config/prod-root-config.yaml +++ b/config/prod-root-config.yaml @@ -89,7 +89,7 @@ utils: reset_collection: True # reset the entire collection each time it is accessed by a new data manager instance embeddings: # choose one embedding from list below - EMBEDDING_NAME: HuggingFaceEmbeddings + EMBEDDING_NAME: OpenAIEmbeddings # list of possible embeddings to use in vectorstore EMBEDDING_CLASS_MAP: OpenAIEmbeddings: