Skip to content

Commit 6602b9a

Browse files
authored
Merge pull request #12 from epoch8/vedana-patch-03
vedana bugfixes #3
2 parents eca59a6 + acc9069 commit 6602b9a

File tree

14 files changed

+678
-177
lines changed

14 files changed

+678
-177
lines changed

apps/vedana/.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ EMBEDDINGS_MAX_TOKENS_PER_BATCH=200000
3434
# App settings
3535
# (optional) Telegram Bot interface
3636
TELEGRAM_BOT_TOKEN=""
37-
# Debug=True allows for some dev/demo-only features in backoffice
38-
DEBUG=true
37+
# VEDANA_BACKOFFICE_DEBUG=True allows for some dev/demo-only features in backoffice
38+
VEDANA_BACKOFFICE_DEBUG=true
39+
# Can also be set by more universal DEBUG=true, but this may effect other components
3940

4041
# Monitoring
4142
SENTRY_DSN=https://3f0e181baff3ef9fcfcb82aa1a58799e@o4508581119000576.ingest.de.sentry.io/4509644080349264

apps/vedana/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
app:
2323
<<: *app-common
2424
ports:
25-
- "3002:3000"
25+
- "9000:9000"
2626
- "8000:8000"
2727
command: vedana-backoffice-with-caddy
2828
depends_on:

libs/vedana-backoffice/src/vedana_backoffice/pages/chat.py

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import reflex as rx
22

3+
from vedana_core.settings import settings as core_settings
34
from vedana_backoffice.components.ui_chat import render_message_bubble
45
from vedana_backoffice.states.chat import ChatState
56
from vedana_backoffice.ui import app_header
@@ -143,34 +144,40 @@ def page() -> rx.Component:
143144
on_change=ChatState.set_input,
144145
width="100%",
145146
),
146-
rx.select(
147-
items=["openai", "openrouter"],
148-
value=ChatState.provider,
149-
on_change=ChatState.set_provider,
150-
width="10em",
151-
placeholder="Provider",
152-
),
153147
rx.cond(
154-
ChatState.provider == "openrouter",
155-
rx.input(
156-
placeholder=rx.cond(
157-
ChatState.default_openrouter_key_present,
158-
"(Optional) custom OPENROUTER_API_KEY",
159-
"(Required) OPENROUTER_API_KEY",
148+
ChatState.model_selection_allowed,
149+
rx.hstack(
150+
rx.select(
151+
items=["openai", "openrouter"],
152+
value=ChatState.provider,
153+
on_change=ChatState.set_provider,
154+
width="10em",
155+
placeholder="Provider",
156+
),
157+
rx.cond(
158+
ChatState.provider == "openrouter",
159+
rx.input(
160+
placeholder=rx.cond(
161+
ChatState.default_openrouter_key_present,
162+
"(Optional) custom OPENROUTER_API_KEY",
163+
"(Required) OPENROUTER_API_KEY",
164+
),
165+
type="password",
166+
value=ChatState.custom_openrouter_key,
167+
on_change=ChatState.set_custom_openrouter_key,
168+
width="36em",
169+
required=rx.cond(ChatState.default_openrouter_key_present, False, True),
170+
),
171+
),
172+
rx.select(
173+
items=ChatState.available_models,
174+
value=ChatState.model,
175+
on_change=ChatState.set_model,
176+
width="16em",
177+
placeholder="Select model",
160178
),
161-
type="password",
162-
value=ChatState.custom_openrouter_key,
163-
on_change=ChatState.set_custom_openrouter_key,
164-
width="36em",
165-
required=rx.cond(ChatState.default_openrouter_key_present, False, True),
166179
),
167-
),
168-
rx.select(
169-
items=ChatState.available_models,
170-
value=ChatState.model,
171-
on_change=ChatState.set_model,
172-
width="16em",
173-
placeholder="Select model",
180+
rx.badge(core_settings.model, variant="surface", color_scheme="gray", size="3"),
174181
),
175182
rx.button("Send", type="submit", loading=ChatState.is_running),
176183
spacing="2",

libs/vedana-backoffice/src/vedana_backoffice/pages/etl.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,24 @@ def _table_preview_dialog() -> rx.Component:
342342

343343

344344
def page() -> rx.Component:
345-
return rx.vstack(
345+
return rx.flex(
346346
app_header(),
347-
_pipeline_tabs(),
348-
_table_preview_dialog(),
349-
align="start",
350-
spacing="1",
351-
padding="1em",
347+
rx.box(
348+
rx.vstack(
349+
_pipeline_tabs(),
350+
_table_preview_dialog(),
351+
align="start",
352+
spacing="1",
353+
width="100%",
354+
),
355+
flex="1",
356+
min_height="0",
357+
overflow="auto",
358+
padding="1em",
359+
width="100%",
360+
),
361+
direction="column",
362+
height="100vh",
363+
overflow="hidden",
352364
width="100%",
353365
)

libs/vedana-backoffice/src/vedana_backoffice/pages/eval.py

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -975,47 +975,69 @@ def _status_messages() -> rx.Component:
975975
def page() -> rx.Component:
976976
return rx.cond(
977977
AppVersionState.eval_enabled,
978-
rx.vstack(
978+
rx.flex(
979979
app_header(),
980-
rx.vstack(
981-
rx.grid(
982-
rx.vstack(
983-
_questions_card(),
984-
_tests_card(),
985-
),
986-
rx.vstack(
987-
_judge_card(),
988-
_pipeline_card(),
989-
_selection_and_actions(),
990-
_status_messages(),
991-
_compare_card(),
980+
rx.box(
981+
rx.vstack(
982+
rx.grid(
983+
rx.vstack(
984+
_questions_card(),
985+
_tests_card(),
986+
),
987+
rx.vstack(
988+
_judge_card(),
989+
_pipeline_card(),
990+
_selection_and_actions(),
991+
_status_messages(),
992+
_compare_card(),
993+
spacing="4",
994+
width="100%",
995+
),
996+
columns="2",
992997
spacing="4",
993998
width="100%",
999+
style={"gridTemplateColumns": "3fr 1fr", "height": "calc(100vh - 200px)", "minHeight": "700px"},
9941000
),
995-
columns="2",
9961001
spacing="4",
9971002
width="100%",
998-
style={"gridTemplateColumns": "3fr 1fr", "height": "calc(100vh - 200px)", "minHeight": "700px"},
9991003
),
1000-
spacing="4",
1004+
_compare_dialog(),
1005+
_judge_prompt_dialog(),
1006+
_data_model_dialog(),
1007+
align="start",
1008+
spacing="2",
1009+
flex="1",
1010+
min_height="0",
1011+
overflow="auto",
1012+
padding="1.5em",
10011013
width="100%",
10021014
),
1003-
_compare_dialog(),
1004-
_judge_prompt_dialog(),
1005-
_data_model_dialog(),
1006-
align="start",
1007-
spacing="2",
1008-
padding="1.5em",
1015+
direction="column",
1016+
height="100vh",
1017+
overflow="hidden",
1018+
width="100%",
10091019
),
1010-
rx.vstack(
1020+
rx.flex(
10111021
app_header(),
1012-
rx.callout(
1013-
"System evaluation page is not available. Configure GRIST_TEST_SET_DOC_ID to enable.",
1014-
color_scheme="red",
1015-
variant="soft",
1022+
rx.box(
1023+
rx.vstack(
1024+
rx.callout(
1025+
"System evaluation page is not available. Configure GRIST_TEST_SET_DOC_ID to enable.",
1026+
color_scheme="red",
1027+
variant="soft",
1028+
),
1029+
align="start",
1030+
spacing="2",
1031+
),
1032+
flex="1",
1033+
min_height="0",
1034+
overflow="auto",
1035+
padding="1.5em",
1036+
width="100%",
10161037
),
1017-
align="start",
1018-
spacing="2",
1019-
padding="1.5em",
1038+
direction="column",
1039+
height="100vh",
1040+
overflow="hidden",
1041+
width="100%",
10201042
),
10211043
)

0 commit comments

Comments
 (0)