gabejavitt commited on
Commit
b09a7c7
Β·
verified Β·
1 Parent(s): ae043fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -29
app.py CHANGED
@@ -1051,35 +1051,35 @@ REMEMBER: One tool per turn. No reasoning without tools. Exact answer format.
1051
  """
1052
 
1053
  #. Initialize the LLM ()
1054
- # print("Initializing Groq LLM...")
1055
- # try:
1056
- # self.llm_with_tools = ChatGroq(
1057
- # temperature=0,
1058
- # groq_api_key=GROQ_API_KEY,
1059
- # model_name="llama-3.1-8b-instant",
1060
- # max_tokens=4096,
1061
- # timeout=60
1062
- # ).bind_tools(self.tools, tool_choice="auto")
1063
- # print("βœ… LLM initialized without FORCED tool usage.")
1064
- #
1065
- # except Exception as e:
1066
- # print(f"❌ Error initializing HuggingFace: {e}")
1067
- # raise
1068
- # print("Initializing LLM Endpoint...")
1069
- print("Initializing HuggingFace LLM...")
1070
-
1071
- llm = HuggingFaceEndpoint(
1072
- repo_id="mistralai/Mixtral-8x7B-Instruct-v0.1", # Free on HF Inference API
1073
- huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
1074
- max_new_tokens=4096,
1075
- temperature=0.01,
1076
- )
1077
- chat_llm = ChatHuggingFace(llm=llm)
1078
- print("βœ… HuggingFace LLM Endpoint initialized.")
1079
-
1080
- # Bind tools to the LLM
1081
- self.llm_with_tools = chat_llm.bind_tools(self.tools)
1082
- print("βœ… Tools bound to LLM.")
1083
  # print("Initializing Google Gemini LLM...")
1084
  # try:
1085
  # self.llm_with_tools = ChatGoogleGenerativeAI(
 
1051
  """
1052
 
1053
  #. Initialize the LLM ()
1054
+ print("Initializing Groq LLM...")
1055
+ try:
1056
+ self.llm_with_tools = ChatGroq(
1057
+ temperature=0,
1058
+ groq_api_key=GROQ_API_KEY,
1059
+ model_name="llama-3.1-8b-instant",
1060
+ max_tokens=4096,
1061
+ timeout=60
1062
+ ).bind_tools(self.tools, tool_choice="auto")
1063
+ print("βœ… LLM initialized without FORCED tool usage.")
1064
+
1065
+ except Exception as e:
1066
+ print(f"❌ Error initializing HuggingFace: {e}")
1067
+ raise
1068
+ print("Initializing LLM Endpoint...")
1069
+ # print("Initializing HuggingFace LLM...")
1070
+ #
1071
+ # llm = HuggingFaceEndpoint(
1072
+ # repo_id="mistralai/Mixtral-8x7B-Instruct-v0.1", # Free on HF Inference API
1073
+ # huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
1074
+ # max_new_tokens=4096,
1075
+ # temperature=0.01,
1076
+ # )
1077
+ # chat_llm = ChatHuggingFace(llm=llm)
1078
+ # print("βœ… HuggingFace LLM Endpoint initialized.")
1079
+ #
1080
+ # # Bind tools to the LLM
1081
+ # self.llm_with_tools = chat_llm.bind_tools(self.tools)
1082
+ # print("βœ… Tools bound to LLM.")
1083
  # print("Initializing Google Gemini LLM...")
1084
  # try:
1085
  # self.llm_with_tools = ChatGoogleGenerativeAI(