Fading_Moments / genparam_old_backup.py
MilanM's picture
Create genparam_old_backup.py
41f2f58 verified
import streamlit as st
from secretsload import load_stsecrets
credentials = load_stsecrets()
# Model Configuration
ACTIVE_MODEL = 0 # 0 == SELECTED_MODEL_1 and PROMPT_TEMPLATE_1
ACTIVE_INDEX = 0 # 0 == VECTOR_INDEX_1
TYPE = "chat" # so that it uses the chat history
SELECTED_MODEL_1 = "meta-llama/llama-3-1-70b-instruct"
SELECTED_MODEL_2 = "mistralai/mistral-large"
# Pick a model_id, you can find them here https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-api-model-ids.html?context=wx&audience=wdp or switch between the two options up there by adjusting the ACTIVE_MODEL variable between 0 (1) and 1 (2).
VERIFY = False
# Prompt Configuration
PROMPT_TEMPLATE_1 = "llama3-instruct (llama-3, 3.1 & 3.2) - system"
PROMPT_TEMPLATE_2 = "mistral & mixtral v2 tokenizer - system segmented"
# <pick prompt template from model_family_syntax below> For example "llama3-instruct (llama-3 & 3.1) - user" if you don't use a system prompt.
BAKE_IN_PROMPT_SYNTAX = True
# Bot Names
BOT_1_NAME = "PATH-er B."
BOT_2_NAME = "MOD-ther S."
BOT_3_NAME = "SYS-ter V."
# Avatars
BOT_1_AVATAR = "🤖" # Robot for PATH-er B.
BOT_2_AVATAR = "🦾" # Mechanical arm for MOD-ther S.
BOT_3_AVATAR = "🎭" # Theatre masks for SYS-ter V.
USER_AVATAR = "👤" # Keep the existing user avatar
# Bot Prompts
BOT_1_PROMPT = str(st.secrets["system_prompt_1"])
BOT_2_PROMPT = str(st.secrets["system_prompt_2"])
BOT_3_PROMPT = str(st.secrets["system_prompt_3"])
# Vector Indexes
VECTOR_INDEX_1 = str(st.secrets["vector_index_id_1"])
VECTOR_INDEX_2 = str(st.secrets["vector_index_id_2"])
# Generation Parameters
DECODING_METHOD = "greedy" # greedy or sample
MAX_NEW_TOKENS = 850
MIN_NEW_TOKENS = 1
REPETITION_PENALTY = 1.0
STOP_SEQUENCES = ["<|end_of_text|>","</s>"] # This one is set up for llama models, if you use mistral </s> is the preferred stop_sequence
# Additional Parameters - Only active if you pick sampling in decoding method
TEMPERATURE = 0.7
TOP_P = 1.0
TOP_K = 50
DISPLAY_CHAT_HISTORY = 1 # 0 to not display chat history, 1 to display chat history
TOKEN_CAPTURE_ENABLED = 0 # Set to 1 to enable token capture preview in the side_bar, 0 to disable