Skip to content

Commit 462da46

Browse files
authored
Merge pull request #128 from stackhpc/fix/gradio-textbox-size
Minor UI improvements and bug fixes
2 parents 8eba191 + 66404e4 commit 462da46

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

charts/azimuth-image-analysis/azimuth-ui.schema.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,5 @@ sortOrder:
2828
- /azimuth-llm/ui/appSettings/llm_params/frequency_penalty
2929
- /azimuth-llm/ui/appSettings/llm_params/presence_penalty
3030
- /azimuth-llm/ui/appSettings/llm_params/top_p
31-
# vLLM responds with HTTP 400 BadRequest when top_k is
32-
# passed to a vision model (but ollama accepts it)
33-
# - /azimuth-llm/ui/appSettings/llm_params/top_k
31+
- /azimuth-llm/ui/appSettings/llm_params/top_k
3432
- /azimuth-llm/api/modelMaxContextLength

charts/azimuth-image-analysis/values.schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@
8989
"exclusiveMinimum": 0,
9090
"maximum": 1
9191
},
92+
"top_k": {
93+
"type": "integer",
94+
"title": "LLM Top K",
95+
"description": "The [top k](https://docs.vllm.ai/en/stable/dev/sampling_params.html) value to use when generating LLM responses (must be an integer).",
96+
"default": -1,
97+
"minimum": -1
98+
},
9299
"presence_penalty": {
93100
"type": "number",
94101
"title": "LLM Presence Penalty",

web-apps/chat/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def inference_wrapper(*args):
185185
height="75vh",
186186
resizable=True,
187187
sanitize_html=True,
188+
autoscroll=False,
188189
latex_delimiters=[
189190
{"left": "$$", "right": "$$", "display": True },
190191
{"left": "$", "right": "$", "display": False }

web-apps/image-analysis/app.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,14 @@ def analyze_image(image_url, prompt):
111111
app = gr.Interface(
112112
fn=analyze_image,
113113
inputs=[
114-
gr.Textbox(label="Image URL"),
115-
gr.Textbox(label="Prompt/Question", elem_id="prompt", scale=2),
114+
gr.Textbox(label="Image URL", lines=2),
115+
gr.Textbox(label="Prompt/Question", elem_id="prompt", scale=2, lines=2),
116116
],
117-
outputs=[gr.Image(label="Image"), gr.Textbox(label="Results")],
118-
flagging_mode='never',
117+
outputs=[
118+
gr.Image(label="Image"),
119+
gr.Textbox(label="Results", lines=2, autoscroll=False),
120+
],
121+
flagging_mode="never",
119122
title=settings.page_title,
120123
description=settings.page_description,
121124
examples=[[ex.image_url, ex.prompt] for ex in settings.examples],

web-apps/image-analysis/gradio-client-test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
gradio_host = sys.argv[1]
77

88
retries = 60
9-
for n in range(1, retries+1):
9+
for n in range(1, retries + 1):
1010
try:
1111
client = Client(gradio_host)
1212
result = client.predict(
1313
image_url="https://media.licdn.com/dms/image/v2/D4D0BAQHyxNra6_PoUQ/company-logo_200_200/company-logo_200_200/0/1704365018113/stackhpc_ltd_logo?e=1747872000&v=beta&t=Ed3-KZS-sHlg-ne1KC0YjI4Ez7yVvJzWr103nm5eVK0",
14-
prompt="Hi",
15-
api_name="/predict"
14+
prompt="Hi",
15+
api_name="/predict",
1616
)
1717
print(result)
1818
break

0 commit comments

Comments
 (0)