Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/itune ready production #45

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added itune_strategy.pkl
Binary file not shown.
16 changes: 15 additions & 1 deletion mind_palace/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

import extract
import index
import openai
Expand All @@ -9,7 +11,19 @@
openai.api_key = st.secrets.openai_key
xml_dir = "./resources/xmls/dennis-oct-10/"
gpt_model = "gpt-3.5-turbo"
itune = Tune(strategy=MultiArmedBandit())


def is_production_env():
return "app_env" in st.secrets.keys() and st.secrets.app_env == "production"


if not is_production_env():
logging.basicConfig(level=logging.INFO)

itune = Tune(
strategy=MultiArmedBandit(),
only_choose_winning_params=is_production_env(),
)

itune.load()

Expand Down
2 changes: 1 addition & 1 deletion requirements/build.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
itune==0.1.1
itune==0.2.0
pypdf==3.16.0
grobid-tei-xml==0.1.3
nltk==3.8.1
Expand Down