bstraehle commited on
Commit
817c8d6
·
1 Parent(s): 30aa93e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
 
3
- #from datetime import date
4
  #from langchain.agents.agent_toolkits import create_python_agent
5
  from langchain.agents import AgentType, initialize_agent, load_tools, tool
6
  #from langchain.tools.python.tool import PythonREPLTool
@@ -32,15 +32,12 @@ def invoke(openai_api_key, prompt):
32
  result = ""
33
 
34
  try:
35
- print("111")
36
  llm = ChatOpenAI(model_name = config["model_name"],
37
  openai_api_key = openai_api_key,
38
  temperature = config["temperature"])
39
 
40
- print("222")
41
  tools = load_tools(["llm-math"], llm = llm)
42
 
43
- print("333")
44
  agent = initialize_agent(
45
  tools + [time],
46
  llm,
@@ -48,7 +45,6 @@ def invoke(openai_api_key, prompt):
48
  handle_parsing_errors = True,
49
  verbose = True)
50
 
51
- print("444")
52
  result = agent(prompt)
53
 
54
  #content = completion.choices[0].message.content
 
1
  import gradio as gr
2
 
3
+ from datetime import date
4
  #from langchain.agents.agent_toolkits import create_python_agent
5
  from langchain.agents import AgentType, initialize_agent, load_tools, tool
6
  #from langchain.tools.python.tool import PythonREPLTool
 
32
  result = ""
33
 
34
  try:
 
35
  llm = ChatOpenAI(model_name = config["model_name"],
36
  openai_api_key = openai_api_key,
37
  temperature = config["temperature"])
38
 
 
39
  tools = load_tools(["llm-math"], llm = llm)
40
 
 
41
  agent = initialize_agent(
42
  tools + [time],
43
  llm,
 
45
  handle_parsing_errors = True,
46
  verbose = True)
47
 
 
48
  result = agent(prompt)
49
 
50
  #content = completion.choices[0].message.content