ChangranHuuu commited on
Commit
46e8c84
·
verified ·
1 Parent(s): b112410

Update dynamic_cheatsheet/language_model.py

Browse files
dynamic_cheatsheet/language_model.py CHANGED
@@ -111,7 +111,8 @@ class LanguageModel:
111
  """
112
  if len(history) == 0:
113
  raise ValueError("History must contain at least one message.")
114
-
 
115
  # The self.client is already a partial function with model, api_key, base_url, etc., pre-filled for SambaNova
116
  response = self.client(
117
  messages=history,
@@ -121,6 +122,8 @@ class LanguageModel:
121
  )
122
  output = response.choices[0].message.content # Corrected access to content
123
 
 
 
124
  pre_code_execution_flag = output.split(code_execution_flag)[0].strip()
125
  if allow_code_execution and code_execution_flag in output and pre_code_execution_flag.endswith("```"):
126
  output_prefix = output.split(code_execution_flag)[0].strip()
 
111
  """
112
  if len(history) == 0:
113
  raise ValueError("History must contain at least one message.")
114
+
115
+ print('history\n', history)
116
  # The self.client is already a partial function with model, api_key, base_url, etc., pre-filled for SambaNova
117
  response = self.client(
118
  messages=history,
 
122
  )
123
  output = response.choices[0].message.content # Corrected access to content
124
 
125
+ print('output\n', output)
126
+
127
  pre_code_execution_flag = output.split(code_execution_flag)[0].strip()
128
  if allow_code_execution and code_execution_flag in output and pre_code_execution_flag.endswith("```"):
129
  output_prefix = output.split(code_execution_flag)[0].strip()