MilanM commited on
Commit
af4b0f9
·
verified ·
1 Parent(s): aeb27b9

Update src/parameters.py

Browse files
Files changed (1) hide show
  1. src/parameters.py +12 -12
src/parameters.py CHANGED
@@ -1,22 +1,22 @@
1
  import os
2
 
3
- model_id = os.getenv("MODEL_ID") or "meta-llama/llama-3-2-90b-vision-instruct"
4
- wx_api_key = os.getenv("WX_API_KEY")
5
- wx_project_id = os.getenv("WX_PROJECT_ID")
6
- wx_url = os.getenv("WX_URL") or "https://eu-de.ml.cloud.ibm.com"
7
- system_prompt = os.getenv("SYSTEM_PROMPT") or ""
8
  params = {
9
- "temperature": os.getenv("TEMPERATURE") or 0.7,
10
- "max_tokens": os.getenv("MAX_TOKENS") or 4096,
11
- "top_p": os.getenv("TOP_P") or 1.0,
12
  "stop": (
13
- os.getenv("STOP_SEQUENCES", "").split(",")
14
  if os.getenv("STOP_SEQUENCES")
15
  else ["</s>", "<|end_of_text|>", "<|endoftext|>"]
16
  ),
17
  # "frequency_penalty": os.getenv("FREQUENCY_PENALTY") or 0.5,
18
  # "presence_penalty": os.getenv("PRESENCE_PENALTY") or 0.3,
19
  }
20
- display_chat_history = os.getenv("DISPLAY_CHAT_HISTORY") or True
21
- stream_outputs = os.getenv("STREAM_OUTPUTS") or True
22
- app_password = os.getenv("APP_PASSWORD","")
 
1
  import os
2
 
3
+ model_id = str(os.getenv("MODEL_ID")) or "meta-llama/llama-3-2-90b-vision-instruct"
4
+ wx_api_key = str(os.getenv("WX_API_KEY"))
5
+ wx_project_id = str(os.getenv("WX_PROJECT_ID"))
6
+ wx_url = str(os.getenv("WX_URL")) or "https://eu-de.ml.cloud.ibm.com"
7
+ system_prompt = str(os.getenv("SYSTEM_PROMPT") or ""
8
  params = {
9
+ "temperature": float(os.getenv("TEMPERATURE")) or 0.7,
10
+ "max_tokens": int(os.getenv("MAX_TOKENS")) or 4096,
11
+ "top_p": float(os.getenv("TOP_P")) or 1.0,
12
  "stop": (
13
+ str(os.getenv("STOP_SEQUENCES")).split(",")
14
  if os.getenv("STOP_SEQUENCES")
15
  else ["</s>", "<|end_of_text|>", "<|endoftext|>"]
16
  ),
17
  # "frequency_penalty": os.getenv("FREQUENCY_PENALTY") or 0.5,
18
  # "presence_penalty": os.getenv("PRESENCE_PENALTY") or 0.3,
19
  }
20
+ display_chat_history = bool(os.getenv("DISPLAY_CHAT_HISTORY")) or True
21
+ stream_outputs = bool(os.getenv("STREAM_OUTPUTS")) or True
22
+ app_password = str(os.getenv("APP_PASSWORD",""))