Update app.py
Browse files
app.py
CHANGED
@@ -31,18 +31,19 @@ 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 |
-
|
35 |
|
36 |
# agent.config.tokenizer = tokenizer
|
37 |
-
|
38 |
|
39 |
# Process the user's message
|
40 |
# inputs = tokenizer.encode_plus(message, add_special_tokens=True, return_tensors="pt")
|
41 |
# outputs = agent(inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
42 |
|
43 |
# Display the agent's response
|
44 |
-
|
45 |
-
|
|
|
46 |
|
47 |
# Add the callback function to the Streamlit app
|
48 |
submit_button = st.button("Submit", on_click=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
|
38 |
|
39 |
# Process the user's message
|
40 |
# inputs = tokenizer.encode_plus(message, add_special_tokens=True, return_tensors="pt")
|
41 |
# outputs = agent(inputs['input_ids'], attention_mask=inputs['attention_mask'])
|
42 |
|
43 |
# Display the agent's response
|
44 |
+
# response = agent.run(message)
|
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)
|