update constants

main
Gustav von Zitzewitz 1 year ago
parent 91743069a9
commit b7b3477d35

@ -14,6 +14,7 @@ from datachad.constants import (
FETCH_K,
LOCAL_MODE_DISABLED_HELP,
MAX_TOKENS,
MODE_HELP,
MODEL_N_CTX,
OPENAI_HELP,
PAGE_ICON,
@ -102,7 +103,11 @@ def advanced_options_form() -> None:
if advanced_options:
with st.form("advanced_options"):
col1, col2 = st.columns(2)
col1.selectbox("model", MODELS.for_mode(st.session_state["mode"]))
col1.selectbox(
"model",
options=MODELS.for_mode(st.session_state["mode"]),
help=f"Learn more about which models are supported [here]({PROJECT_URL})",
)
col2.number_input(
"temperature",
min_value=0.0,
@ -155,7 +160,7 @@ def advanced_options_form() -> None:
# Sidebar with Authentication and Advanced Options
with st.sidebar:
mode = st.selectbox("Mode", MODES.all(), key="mode")
mode = st.selectbox("Mode", MODES.all(), key="mode", help=MODE_HELP)
if mode == MODES.LOCAL and not ENABLE_LOCAL_MODE:
st.error(LOCAL_MODE_DISABLED_HELP, icon=PAGE_ICON)
st.stop()

@ -21,11 +21,15 @@ GPT4ALL_MODEL_PATH = "models/ggml-gpt4all-j-v1.3-groovy.bin"
DATA_PATH = Path.cwd() / "data"
DEFAULT_DATA_SOURCE = "https://github.com/gustavz/DataChad.git"
MODEL_HELP = "Learn more about which models are supported [here](https://github.com/gustavz/DataChad/blob/main/datachad/models.py)"
MODE_HELP = """
Choose between `OpenAI` which uses the openai library to make API calls, or `Local` which runs all operations (Embedding, Vector Stor and LLM) locally.\n
To enable `Local` mode (disabled for the demo) set `ENABLE_LOCAL_MODE` to `True` in `datachad/constants.py` before deploying the app.\n
Furthermore you need to have the model binaries downloaded and stored inside `./models/`\n
"""
LOCAL_MODE_DISABLED_HELP = """
This is a demo hosted with limited resources. Local Mode is not enabled.\n
To use Local Mode deploy the app on your machine of choice with ENABLE_LOCAL_MODE set to True.
To use Local Mode deploy the app on your machine of choice with `ENABLE_LOCAL_MODE` set to `True`.
"""
AUTHENTICATION_HELP = f"""
@ -36,7 +40,7 @@ Feel free to check out [the code base]({PROJECT_URL}) to validate how things wor
USAGE_HELP = f"""
These are the accumulated OpenAI API usage metrics.\n
The app uses 'gpt-3.5-turbo' for chat and 'text-embedding-ada-002' for embeddings.\n
The app uses `gpt-3.5-turbo` for chat and `text-embedding-ada-002` for embeddings.\n
Learn more about OpenAI's pricing [here](https://openai.com/pricing#language-models)
"""

Loading…
Cancel
Save