Chris4K commited on
Commit
4da4c03
·
verified ·
1 Parent(s): 403bf0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -65,6 +65,8 @@ st.title("Hugging Face Agent")
65
  message_input = st.text_input("Enter your message:", "")
66
 
67
  # Checkboxes for the tools to be used by the agent
 
 
68
  tool_checkboxes = [st.checkbox(f"Use {tool}") for tool in tools]
69
 
70
  # Submit button
@@ -74,7 +76,13 @@ tool_checkboxes = [st.checkbox(f"Use {tool}") for tool in tools]
74
  def handle_submission():
75
  # Get the user's message and the selected tools
76
  message = st.text_input("Enter your message:", "")
77
- selected_tools = [tool for tool, checkbox in tool_checkboxes]
 
 
 
 
 
 
78
 
79
  # Initialize the agent
80
  agent = CustomHfAgent(url_endpoint="https://api-inference.huggingface.co/models/bigcode/starcoder", token=os.environ['HF_token'])
 
65
  message_input = st.text_input("Enter your message:", "")
66
 
67
  # Checkboxes for the tools to be used by the agent
68
+
69
+
70
  tool_checkboxes = [st.checkbox(f"Use {tool}") for tool in tools]
71
 
72
  # Submit button
 
76
  def handle_submission():
77
  # Get the user's message and the selected tools
78
  message = st.text_input("Enter your message:", "")
79
+
80
+ selected_tools = []
81
+ for tool, checkbox in tool_checkboxes:
82
+ if checkbox:
83
+ selected_tools.append(tool)
84
+
85
+ #selected_tools = [tool for tool, checkbox in tool_checkboxes]
86
 
87
  # Initialize the agent
88
  agent = CustomHfAgent(url_endpoint="https://api-inference.huggingface.co/models/bigcode/starcoder", token=os.environ['HF_token'])