reygml commited on
Commit
5b9a7b6
·
1 Parent(s): b6e71f1
Files changed (1) hide show
  1. ui.py +8 -1
ui.py CHANGED
@@ -12,6 +12,7 @@ st.title("SmolVLM Grounding")
12
 
13
  API_BASE = os.getenv("API_BASE", "http://127.0.0.1:8000")
14
 
 
15
  with st.sidebar:
16
  st.subheader("Generation settings")
17
  max_new_tokens = st.slider("max_new_tokens", 1, 1024, 300, step=1)
@@ -20,6 +21,7 @@ with st.sidebar:
20
  topp_on = st.toggle("Set top_p?", value=False)
21
  top_p = st.slider("top_p", 0.05, 1.0, 0.95, step=0.05) if topp_on else None
22
  st.caption("API base: " + API_BASE)
 
23
 
24
  def show_metrics(metrics: dict):
25
  if not metrics:
@@ -44,7 +46,12 @@ with tab_upload:
44
  files = st.file_uploader("Images", type=["png", "jpg", "jpeg", "webp"], accept_multiple_files=True)
45
  prompt = st.text_area("Prompt", "Can you describe the image?", height=80)
46
  run = st.button("Generate", type="primary", use_container_width=True, key="run_files")
47
-
 
 
 
 
 
48
  if run:
49
  if not files or not prompt.strip():
50
  st.error("Please add at least one image and a prompt.")
 
12
 
13
  API_BASE = os.getenv("API_BASE", "http://127.0.0.1:8000")
14
 
15
+ """
16
  with st.sidebar:
17
  st.subheader("Generation settings")
18
  max_new_tokens = st.slider("max_new_tokens", 1, 1024, 300, step=1)
 
21
  topp_on = st.toggle("Set top_p?", value=False)
22
  top_p = st.slider("top_p", 0.05, 1.0, 0.95, step=0.05) if topp_on else None
23
  st.caption("API base: " + API_BASE)
24
+ """
25
 
26
  def show_metrics(metrics: dict):
27
  if not metrics:
 
46
  files = st.file_uploader("Images", type=["png", "jpg", "jpeg", "webp"], accept_multiple_files=True)
47
  prompt = st.text_area("Prompt", "Can you describe the image?", height=80)
48
  run = st.button("Generate", type="primary", use_container_width=True, key="run_files")
49
+ max_new_tokens = st.slider("max_new_tokens", 1, 1024, 300, step=1)
50
+ temperature_on = st.toggle("Set temperature?", value=False)
51
+ temperature = st.slider("temperature", 0.0, 2.0, 0.2, step=0.05) if temperature_on else None
52
+ topp_on = st.toggle("Set top_p?", value=False)
53
+ top_p = st.slider("top_p", 0.05, 1.0, 0.95, step=0.05) if topp_on else None
54
+ st.caption("API base: " + API_BASE)
55
  if run:
56
  if not files or not prompt.strip():
57
  st.error("Please add at least one image and a prompt.")