mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 09:21:45 +00:00
add max_token slider to playground tools page
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
This commit is contained in:
parent
86c6f1f112
commit
4a7b26042d
1 changed files with 12 additions and 3 deletions
|
@ -56,6 +56,17 @@ def tool_chat_page():
|
||||||
st.subheader(f"Active Tools: 🛠 {len(active_tool_list)}")
|
st.subheader(f"Active Tools: 🛠 {len(active_tool_list)}")
|
||||||
st.json(active_tool_list)
|
st.json(active_tool_list)
|
||||||
|
|
||||||
|
st.subheader("Chat Configurations")
|
||||||
|
max_tokens = st.slider(
|
||||||
|
"Max Tokens",
|
||||||
|
min_value=0,
|
||||||
|
max_value=4096,
|
||||||
|
value=512,
|
||||||
|
step=1,
|
||||||
|
help="The maximum number of tokens to generate",
|
||||||
|
on_change=reset_agent,
|
||||||
|
)
|
||||||
|
|
||||||
@st.cache_resource
|
@st.cache_resource
|
||||||
def create_agent():
|
def create_agent():
|
||||||
return Agent(
|
return Agent(
|
||||||
|
@ -63,9 +74,7 @@ def tool_chat_page():
|
||||||
model=model,
|
model=model,
|
||||||
instructions="You are a helpful assistant. When you use a tool always respond with a summary of the result.",
|
instructions="You are a helpful assistant. When you use a tool always respond with a summary of the result.",
|
||||||
tools=toolgroup_selection,
|
tools=toolgroup_selection,
|
||||||
sampling_params={
|
sampling_params={"strategy": {"type": "greedy"}, "max_tokens": max_tokens},
|
||||||
"strategy": {"type": "greedy"},
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
agent = create_agent()
|
agent = create_agent()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue