Chris4K commited on
Commit
6c04e26
·
verified ·
1 Parent(s): 441e1c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -22,7 +22,11 @@ message_input = st.text_input("Enter your message:", "")
22
  tool_checkboxes = [st.checkbox(f"Use {tool}") for tool in tools]
23
 
24
  # Submit button
25
- submit_button = st.button("Submit")
 
 
 
 
26
 
27
  # Define the callback function to handle the form submission
28
  def handle_submission():
@@ -31,7 +35,7 @@ def handle_submission():
31
  selected_tools = [tool for tool, checkbox in zip(tools, tool_checkboxes) if checkbox]
32
 
33
  # Initialize the agent with the selected tools
34
- # agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder", additional_tools=tools)
35
 
36
  # agent.config.tokenizer = tokenizer
37
  # agent.config.tools = selected_tools
@@ -45,7 +49,3 @@ def handle_submission():
45
  # st.text(f"{response:.4f}")
46
  return "done"
47
 
48
- # Add the callback function to the Streamlit app
49
- submit_button = st.button("Submit", on_click=handle_submission)
50
-
51
-
 
22
  tool_checkboxes = [st.checkbox(f"Use {tool}") for tool in tools]
23
 
24
  # Submit button
25
+ #submit_button = st.button("Submit")
26
+
27
+ # Add the callback function to the Streamlit app
28
+ submit_button = st.button("Submit", on_click=handle_submission)
29
+
30
 
31
  # Define the callback function to handle the form submission
32
  def handle_submission():
 
35
  selected_tools = [tool for tool, checkbox in zip(tools, tool_checkboxes) if checkbox]
36
 
37
  # Initialize the agent with the selected tools
38
+ agent = HfAgent("https://api-inference.huggingface.co/models/bigcode/starcoder", additional_tools=tools)
39
 
40
  # agent.config.tokenizer = tokenizer
41
  # agent.config.tools = selected_tools
 
49
  # st.text(f"{response:.4f}")
50
  return "done"
51