Maharshi Gor
Enhances model selection and logging in pipeline components; adds logprobs support and improves UI feedback for disabled sliders.
4f5d1cb
css_pipeline = """ | |
:root { | |
color-scheme: light !important; | |
--block-border-width: 0 !important; | |
--section-header-text-weight: 600 !important; | |
--section-header-text-size: 14px !important; | |
--input-radius: var(--radius-xl) !important; | |
--font-mono: "Space Mono", monospace !important; | |
--text-sm: 12px !important; | |
--text-md: 14px !important; | |
--text-lg: 16px !important; | |
--input-text-size: var(--text-sm) !important; | |
--body-text-size: 14px !important; | |
--input-background-fill-focus: var(--secondary-300) !important; | |
// Button Colors | |
--button-primary-background-fill: var(--primary-800) !important; | |
--button-secondary-background-fill: var(--secondary-600) !important; | |
--checkbox-label-text-color: var(--body-text-color) !important; | |
--card-bg-color: #fcecd4; | |
--card-btn-color: #D4E4FC; | |
--card-btn-color-hover: #7DAEF6; | |
--answer-bg-color: #f0f8ff; | |
--hover-border-color: #121212; | |
} | |
:root .dark { | |
color-scheme: dark !important; | |
--block-border-width: 0 !important; | |
--section-header-text-weight: 600 !important; | |
--section-header-text-size: 14px !important; | |
--input-radius: var(--radius-xl) !important; | |
--font-mono: "Space Mono", monospace !important; | |
--text-sm: 12px !important; | |
--text-md: 14px !important; | |
--text-lg: 16px !important; | |
--input-text-size: var(--text-sm) !important; | |
--body-text-size: 14px !important; | |
--button-primary-background-fill: var(--neutral-100) !important; | |
--button-secondary-background-fill: var(--secondary-300) !important; | |
--button-primary-text-color: black !important; | |
--button-secondary-text-color: black !important; | |
--checkbox-label-text-color: var(--body-text-color) !important; | |
--card-bg-color: #383127; | |
--answer-bg-color: #1a2b3c; | |
--hover-border-color: #ffffff; | |
} | |
.gradio-app { | |
// font-family: Arial, sans-serif; | |
} | |
.form { | |
box-shadow: 0 0 0 0 !important; | |
} | |
.slider-container .wrap { | |
gap: var(--spacing-md) !important; | |
} | |
input[type=range][disabled] { | |
opacity: .3; | |
} | |
.json-node { | |
/* On a light background (usually white), use darker and vivid colors */ | |
font-size: var(--text-sm) !important; | |
--text-color: #2e2e2e; /* Dark grey text for overall readability */ | |
--key-color: #d73a49; /* Bright red for keys */ | |
--string-color: #22863a; /* Bold green for strings */ | |
--number-color: #0366d6; /* Vivid blue for numbers */ | |
--bracket-color: #6f42c1; /* Distinct purple for regular brackets */ | |
--square-bracket-color: #e36209; /* Eye-popping orange for square brackets */ | |
--punctuation-color: #17a2b8; /* Turquoise punctuation */ | |
--line-number-color: #6a737d; /* Used for line numbers if shown */ | |
--separator-color: var(--line-number-color); | |
} | |
.head { | |
margin-bottom: 0px; | |
} | |
.icon-wrap { | |
right: var(--size-1) !important; | |
} | |
.gradio-container { | |
max-width: 1500px; | |
margin: 0 auto; | |
padding: 0 8px; | |
} | |
.html-container { | |
padding: 0px 0px; | |
margin: 4px 0px; | |
border-radius: 12px; | |
gap: 0px | |
} | |
.tabs { | |
gap: var(--spacing-md) !important; | |
} | |
.tab-buttons button { | |
font-size: 20px; | |
} | |
.step-container { | |
background-color: var(--card-bg-color); | |
padding: 0px 0px; | |
margin: 4px 0px; | |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | |
border-radius: 12px; | |
gap: 0px | |
} | |
.step-container:hover { | |
border-color: var(--hover-border-color); | |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); | |
} | |
.step-accordion { | |
background-color: var(--card-bg-color); | |
border: 0px solid #e0e0e0 !important; | |
border-radius: 12px; | |
overflow: hidden; | |
// transition: box-shadow 0.3s ease, border-color 0.3s ease; | |
padding: 8px 8px; | |
font-size: 12px; | |
} | |
.control-panel { | |
gap: var(--spacing-xs) !important; | |
} | |
.toggleable { | |
gap: var(--spacing-xs) !important; | |
} | |
.output-fields-panel { | |
background-color: var(--card-bg-color); | |
border: 0px solid #e0e0e0 !important; | |
border-radius: 12px; | |
overflow: hidden; | |
transition: box-shadow 0.3s ease, border-color 0.3s ease; | |
padding: 8px 8px; | |
font-size: 12px; | |
} | |
.model-submission-accordion { | |
background-color: var(--card-bg-color); | |
border: 0px solid #e0e0e0 !important; | |
border-radius: 12px; | |
overflow: hidden; | |
transition: box-shadow 0.3s ease, border-color 0.3s ease; | |
font-size: 14px; | |
} | |
.model-submission-accordion > label-wrap { | |
font-size: 16px; | |
font-weight: bold !important; | |
} | |
.step-accordion:hover .step-name-input input { | |
font-weight: bold; | |
} | |
.step-accordion > label-wrap { | |
font-size: 14px; | |
font-weight: bold !important; | |
} | |
.step-header-row { | |
margin: 0px 0px; | |
padding: 0px 0px; | |
border: 0px !important; | |
} | |
.step-header-row form { | |
margin: 0px 0px; | |
padding: 0px 0px; | |
border: 0px !important; | |
} | |
.step-name { | |
margin: 0px | |
padding: 0px 0px; | |
// border-radius: 8px; | |
border: 0px !important | |
} | |
.model-dropdown { | |
margin: 0px | |
padding: 0px 8px; | |
} | |
.model-dropdown input { | |
padding-bottom: 2px; | |
padding-top: 2px; | |
} | |
.step-name input { | |
font-size: var(--text-md); | |
font-weight: bold; | |
padding-bottom: 8px; | |
margin-bottom: 4px; | |
border-radius: 12px !important; | |
} | |
.step-controls { | |
display: flex; | |
justify-content: flex-end; | |
gap: 12px; | |
background-color: var(--card-bg-color); | |
border-radius: 12px; | |
padding: 0px | |
border: 1px solid black; | |
} | |
.step-control-btn { | |
background-color: var(--card-btn-color); | |
font-size: 12px !important; | |
color: var(--body-text-color); | |
min-width: 36px !important; | |
min-height: 24px !important; | |
padding: 4px !important; | |
margin: 8px !important; | |
border-radius: 12px; | |
} | |
.step-control-btn:hover { | |
background-color: var(--card-btn-color-hover); | |
} | |
.step-tabs { | |
margin-top: 0px; | |
padding: 0px 0px; | |
border-radius: 0px; | |
border: 0px | |
background-color: transparent; | |
} | |
.tab-content { | |
padding: 0px 0px; | |
margin-bottom: 0px; | |
border-radius: 4px; | |
border: 0px solid #eee; | |
background-color: transparent !important; | |
} | |
.fields-panel { | |
background-color: transparent !important; | |
gap: 5px !important; | |
border-radius: 4px; | |
padding: 2px; | |
} | |
.field-row { | |
margin-bottom: 1px; | |
margin-top: 1px; | |
padding: 2px; | |
border-radius: 8px; | |
background-color: var(--block-background-fill) !important; | |
border: 0px solid #eee; | |
gap: 0px !important; | |
} | |
.output-field-row { | |
margin-bottom: 1px; | |
margin-top: 1px; | |
padding: 2px; | |
border-radius: 4px; | |
background-color: var(--block-background-fill) !important; | |
border: 0px solid #eee; | |
gap: 0px !important; | |
} | |
.panel-header-container { | |
padding: 0px 8px; | |
} | |
.panel-header { | |
margin-bottom: 0px; | |
} | |
.panel-subheader { | |
margin-top: 0px; | |
margin-bottom: 0px; | |
} | |
.output-field-variable { | |
font-family: var(--font-mono) !important; | |
font-weight: 300 !important; | |
font-size: 12px !important; | |
padding: 8px 8px; | |
border-radius: 4px; | |
border: 0px solid #eee !important; | |
} | |
.output-field-variable span { | |
font-size: 12px !important; | |
} | |
.field-type { | |
min-width: 100px !important; | |
} | |
.field-name > label, .field-variable > label, .field-description > label, .field-type > label { | |
font-size: 12px !important; | |
} | |
.field-name input, .field-description input, .field-type input { | |
font-family: var(--font-mono) !important; | |
font-size: 12px !important; | |
} | |
.field-variable input, .field-type input, .output-field-variable input { | |
font-family: var(--font-mono) !important; | |
font-size: 12px !important; | |
padding-top: 1px; | |
padding-bottom: 1px; | |
} | |
.field-name listbox, .field-variable listbox, .field-type listbox { | |
font-family: var(--font-mono) !important; | |
padding-top: 1px; | |
padding-bottom: 1px; | |
font-size: 12px !important; | |
} | |
.field-description { | |
font-size: 12px !important; | |
} | |
/* Accordion button labels */ | |
.step-accordion button.label-wrap { | |
font-size: 14px; | |
font-weight: bold !important; | |
font-family: var(--font-mono) !important; | |
} | |
.step-accordion button.label-wrap.open { | |
font-size: 14px; | |
font-weight: bold !important; | |
font-family: var(--font-mono) !important; | |
} | |
.button-column { | |
margin-top: 2px; | |
margin-bottom: 2px; | |
padding-top: 2px; | |
padding-bottom: 2px; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
gap: 4x !important; | |
height: 100%; | |
} | |
.icon-button { | |
min-width: 28px !important; | |
max-width: 42px !important; | |
height: 28px !important; | |
max-height: 42px !important; | |
padding: 0 !important; | |
border-radius: 4px !important; | |
transition: background-color 0.2s ease, color 0.2s ease; | |
} | |
.delete-button { | |
background-color: #ffebee !important; | |
color: #d32f2f !important; | |
} | |
.delete-button:hover { | |
background-color: #ffcdd2 !important; | |
} | |
.up-button, .down-button { | |
background-color: #e3f2fd !important; | |
color: #1976d2 !important; | |
} | |
.up-button:hover, .down-button:hover { | |
background-color: #bbdefb !important; | |
} | |
.add-field-button { | |
background-color: #e8f5e9 !important; | |
color: #2e7d32 !important; | |
} | |
.add-field-button:hover, .add-step-button:hover { | |
background-color: #c8e6c9 !important; | |
} | |
.pipeline-controls { | |
border-top: 1px solid #eee; | |
padding-top: 8px; | |
} | |
.pipeline-header { | |
border-bottom: 1px solid #eee; | |
padding: 8px 0px; | |
} | |
.pipeline-footer { | |
border-top: 1px solid #eee; | |
padding: 8px 0px; | |
} | |
.add-step-button { | |
background-color: #e8f5e9 !important; | |
color: #2e7d32 !important; | |
border-radius: 12px; | |
} | |
.export-button { | |
background-color: #e0f7f5 !important; | |
color: #00796b !important; | |
border-radius: 12px; | |
} | |
.export-button:hover { | |
background-color: #b2dfdb !important; | |
} | |
.pipeline-preview { | |
background-color: var(--card-bg-color); | |
border-radius: 12px; | |
box-shadow: 0 0 0 0 !important; | |
} | |
""" | |
css_tossup = """ | |
.token { | |
display: inline-block; | |
padding: 1px 3px; | |
margin: 1px; | |
border-radius: 4px; | |
cursor: pointer; | |
transition: background-color 0.2s; | |
position: relative; | |
} | |
.answer-header { | |
font-weight: 900; | |
font-size: 16px; | |
padding: 8px; | |
border-radius: 8px; | |
background-color: var(--answer-bg-color) !important; | |
} | |
.answer-box textarea { | |
font-size: 16px; | |
padding: 8px; | |
border-radius: 8px; | |
background-color: var(--answer-bg-color) !important; | |
} | |
.token:hover, .token.highlighted { | |
background-color: #ffcc00; | |
} | |
.token.guess-point { | |
border-top: 1px solid; | |
border-left: 3px solid; | |
border-right: 1px solid; | |
border-bottom: 1px solid; | |
} | |
.token.no-buzz { | |
border-color: #808080; | |
} | |
.token.buzz-0 { | |
border-color: #ff4444; | |
} | |
.token.buzz-1 { | |
border-color: #228b22; /* Darker and slightly muted green */ | |
} | |
.tossup-question { | |
line-height: 1.5; | |
padding: 5px; | |
margin-left: 4px; | |
margin-right: 4px; | |
background-color: var(--answer-bg-color) !important; | |
border-radius: 8px; | |
margin-bottom: 10px; | |
} | |
/* Tooltip styles */ | |
.tooltip { | |
display: none; | |
position: fixed; /* Changed to fixed for better positioning */ | |
padding: 12px 16px; | |
border-radius: 8px; | |
font-size: 13px; | |
white-space: normal; | |
z-index: 1000; | |
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
min-width: 300px; | |
max-width: 400px; | |
backdrop-filter: blur(4px); | |
border: 1px solid rgba(255, 255, 255, 0.2); | |
} | |
.tooltip-content { | |
color: #2c3e50; /* Darker text for better readability */ | |
} | |
.tooltip-content div { | |
margin: 4px 0; | |
line-height: 1.4; | |
} | |
/* When hovering over a token, show its tooltip */ | |
.token:hover .tooltip { | |
display: block; | |
} | |
/* Add a small arrow to the tooltip */ | |
.tooltip::after { | |
content: ''; | |
position: absolute; | |
bottom: -8px; | |
left: 50%; | |
transform: translateX(-50%); | |
border-left: 8px solid transparent; | |
border-right: 8px solid transparent; | |
border-top: 8px solid currentColor; | |
} | |
""" | |
css_bonus = """ | |
.qid-selector { | |
box-shadow: 0 0 0 0 !important; | |
} | |
.qid-selector input { | |
border-radius: 12px !important; | |
} | |
.bonus-header-row { | |
align-items: flex-end; | |
} | |
.bonus-card { | |
background-color: var(--card-bg-color); | |
border-radius: 12px; | |
padding: 12px; | |
margin: 0px 0px; | |
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | |
} | |
.bonus-leadin { | |
font-size: 14px; | |
font-weight: 500; | |
margin-bottom: 12px; | |
line-height: 1.5; | |
} | |
.bonus-part { | |
background-color: var(--answer-bg-color); | |
border-radius: 8px; | |
padding: 12px; | |
margin: 8px 0; | |
} | |
.bonus-part-number { | |
font-weight: 600; | |
color: #666; | |
margin-bottom: 4px; | |
} | |
.bonus-part-text { | |
margin-bottom: 8px; | |
line-height: 1.5; | |
} | |
.bonus-answer { | |
background-color: #fff5f5; | |
border-radius: 6px; | |
padding: 8px 12px; | |
margin-top: 8px; | |
font-size: 14px; | |
border-left: 3px solid #ff6b6b; | |
} | |
.bonus-answer-label { | |
font-weight: 500; | |
color: #666; | |
margin-bottom: 4px; | |
} | |
.bonus-answer-text { | |
color: #333; | |
} | |
.bonus-container { | |
max-width: 800px; | |
margin: 0 auto; | |
padding-left: 8px; | |
padding-right: 8px; | |
} | |
""" | |