MilanM commited on
Commit
41f2f58
·
verified ·
1 Parent(s): f963ea9

Create genparam_old_backup.py

Browse files
Files changed (1) hide show
  1. genparam_old_backup.py +55 -0
genparam_old_backup.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from secretsload import load_stsecrets
3
+
4
+ credentials = load_stsecrets()
5
+
6
+ # Model Configuration
7
+ ACTIVE_MODEL = 0 # 0 == SELECTED_MODEL_1 and PROMPT_TEMPLATE_1
8
+ ACTIVE_INDEX = 0 # 0 == VECTOR_INDEX_1
9
+
10
+ TYPE = "chat" # so that it uses the chat history
11
+ SELECTED_MODEL_1 = "meta-llama/llama-3-1-70b-instruct"
12
+ SELECTED_MODEL_2 = "mistralai/mistral-large"
13
+ # 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).
14
+ VERIFY = False
15
+
16
+ # Prompt Configuration
17
+ PROMPT_TEMPLATE_1 = "llama3-instruct (llama-3, 3.1 & 3.2) - system"
18
+ PROMPT_TEMPLATE_2 = "mistral & mixtral v2 tokenizer - system segmented"
19
+ # <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.
20
+ BAKE_IN_PROMPT_SYNTAX = True
21
+
22
+ # Bot Names
23
+ BOT_1_NAME = "PATH-er B."
24
+ BOT_2_NAME = "MOD-ther S."
25
+ BOT_3_NAME = "SYS-ter V."
26
+
27
+ # Avatars
28
+ BOT_1_AVATAR = "🤖" # Robot for PATH-er B.
29
+ BOT_2_AVATAR = "🦾" # Mechanical arm for MOD-ther S.
30
+ BOT_3_AVATAR = "🎭" # Theatre masks for SYS-ter V.
31
+ USER_AVATAR = "👤" # Keep the existing user avatar
32
+
33
+ # Bot Prompts
34
+ BOT_1_PROMPT = str(st.secrets["system_prompt_1"])
35
+ BOT_2_PROMPT = str(st.secrets["system_prompt_2"])
36
+ BOT_3_PROMPT = str(st.secrets["system_prompt_3"])
37
+
38
+ # Vector Indexes
39
+ VECTOR_INDEX_1 = str(st.secrets["vector_index_id_1"])
40
+ VECTOR_INDEX_2 = str(st.secrets["vector_index_id_2"])
41
+
42
+ # Generation Parameters
43
+ DECODING_METHOD = "greedy" # greedy or sample
44
+ MAX_NEW_TOKENS = 850
45
+ MIN_NEW_TOKENS = 1
46
+ REPETITION_PENALTY = 1.0
47
+ STOP_SEQUENCES = ["<|end_of_text|>","</s>"] # This one is set up for llama models, if you use mistral </s> is the preferred stop_sequence
48
+
49
+ # Additional Parameters - Only active if you pick sampling in decoding method
50
+ TEMPERATURE = 0.7
51
+ TOP_P = 1.0
52
+ TOP_K = 50
53
+
54
+ DISPLAY_CHAT_HISTORY = 1 # 0 to not display chat history, 1 to display chat history
55
+ TOKEN_CAPTURE_ENABLED = 0 # Set to 1 to enable token capture preview in the side_bar, 0 to disable