Skip to content

Commit

Permalink
Merge pull request #136 from mit-submit/main
Browse files Browse the repository at this point in the history
short-term release with openAIEmbeddings
  • Loading branch information
ludomori99 authored Oct 30, 2023
2 parents 10dca6c + 2d71e64 commit d719667
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
5 changes: 5 additions & 0 deletions A2rchi/chains/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -32,13 +33,17 @@ class DumbLLM(BaseCustomLLM):
A simple Dumb LLM, perfect for testing
"""
filler: str = None
sleep_time_mean: int = 3

def _call(
self,
prompt: str = None,
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):
Expand Down
30 changes: 15 additions & 15 deletions config/801-textbook.list
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
https://mit-teal.github.io/801/textbook/chapter31.pdf
7 changes: 4 additions & 3 deletions config/dev-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/prod-root-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d719667

Please sign in to comment.