OuroborosM commited on
Commit
235a43e
·
1 Parent(s): b874666

update llm

Browse files
Files changed (1) hide show
  1. app.py +29 -3
app.py CHANGED
@@ -521,9 +521,9 @@ chat = AzureChatOpenAI(
521
  )
522
 
523
 
524
- # llm = chat
525
 
526
- llm = GPTfake
527
 
528
  llm_math = LLMMathChain.from_llm(llm)
529
 
@@ -654,6 +654,7 @@ prompt_openai = OpenAIMultiFunctionsAgent.create_prompt(
654
 
655
  input_variables=["input", "chat_history", "agent_scratchpad"]
656
 
 
657
  agent_ZEROSHOT_REACT = initialize_agent(tools2, llm,
658
  # agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
659
  agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
@@ -674,6 +675,27 @@ agent_ZEROSHOT_REACT = initialize_agent(tools2, llm,
674
 
675
  )
676
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  llm_chain = LLMChain(llm=llm, prompt=prompt)
678
 
679
  # llm_chain_openai = LLMChain(llm=llm, prompt=prompt_openai, verbose=True)
@@ -718,6 +740,10 @@ elif Choice =='Zero Short React':
718
  elif Choice =='OpenAI Multi':
719
  agent = agent_OPENAI_MULTI
720
  print("Set to:", Choice)
 
 
 
 
721
  # agent = agent_ZEROSHOT_AGENT
722
 
723
 
@@ -1185,7 +1211,7 @@ with gr.Blocks() as demo:
1185
  with gr.Row():
1186
 
1187
  agentchoice = gr.Dropdown(
1188
- choices=['Zero Short Agent','Zero Short React','OpenAI Multi'],
1189
  label="SELECT AI AGENT",
1190
  scale= 2,
1191
  show_label = True,
 
521
  )
522
 
523
 
524
+ llm = chat
525
 
526
+ # llm = GPTfake
527
 
528
  llm_math = LLMMathChain.from_llm(llm)
529
 
 
654
 
655
  input_variables=["input", "chat_history", "agent_scratchpad"]
656
 
657
+
658
  agent_ZEROSHOT_REACT = initialize_agent(tools2, llm,
659
  # agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
660
  agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
 
675
 
676
  )
677
 
678
+ agent_ZEROSHOT_REACT_2 = initialize_agent(tools2, GPTfake,
679
+ # agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
680
+ agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
681
+ verbose = True,
682
+ handle_parsing_errors = True,
683
+ max_iterations = int(os.environ["max_iterations"]),
684
+ early_stopping_method="generate",
685
+ agent_kwargs={
686
+ 'prefix': PREFIX,
687
+ 'format_instructions': FORMAT_INSTRUCTIONS,
688
+ 'suffix': SUFFIX,
689
+ # 'input_variables': input_variables,
690
+ },
691
+ # input_variables = input_variables,
692
+ # agent_kwargs={
693
+ # 'prompt': prompt,
694
+ # }
695
+
696
+ )
697
+
698
+
699
  llm_chain = LLMChain(llm=llm, prompt=prompt)
700
 
701
  # llm_chain_openai = LLMChain(llm=llm, prompt=prompt_openai, verbose=True)
 
740
  elif Choice =='OpenAI Multi':
741
  agent = agent_OPENAI_MULTI
742
  print("Set to:", Choice)
743
+ elif Choice =='Zero Short React 2':
744
+ agent = agent_ZEROSHOT_REACT_2
745
+ print("Set to:", Choice)
746
+
747
  # agent = agent_ZEROSHOT_AGENT
748
 
749
 
 
1211
  with gr.Row():
1212
 
1213
  agentchoice = gr.Dropdown(
1214
+ choices=['Zero Short Agent','Zero Short React','OpenAI Multi','Zero Short React 2'],
1215
  label="SELECT AI AGENT",
1216
  scale= 2,
1217
  show_label = True,