Skip to content

Commit efd649c

Browse files
authored
Merge branch 'master' into search-box-in-header
2 parents cfc865e + ae608f7 commit efd649c

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

daras_ai_v2/language_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ class LargeLanguageModels(Enum):
122122
price=1,
123123
is_vision_model=True,
124124
supports_json=True,
125+
is_deprecated=True,
126+
redirect_to="gpt_4_o",
125127
)
126128

127129
# https://platform.openai.com/docs/models/o4-mini

recipes/CompareText2Img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ def _render_outputs(self, state):
269269

270270
def get_raw_price(self, state: dict) -> int:
271271
selected_models = state.get("selected_models", [])
272-
grouped_costs = self.get_grouped_linked_usage_cost_in_credits()
273272
total = 0
274273
for name in selected_models:
275274
match name:
@@ -278,6 +277,7 @@ def get_raw_price(self, state: dict) -> int:
278277
case Text2ImgModels.dall_e.name | Text2ImgModels.dall_e_3.name:
279278
total += 15
280279
case Text2ImgModels.gpt_image_1.name:
280+
grouped_costs = self.get_grouped_linked_usage_cost_in_credits()
281281
if cost := grouped_costs.get(Text2ImgModels.gpt_image_1.name):
282282
total += math.ceil(float(cost) * 2.5)
283283
continue

recipes/Functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def render_variables(self):
236236
def render_output(self):
237237
if error := gui.session_state.get("error"):
238238
with gui.tag("pre", className="bg-danger bg-opacity-25"):
239-
gui.html(error)
239+
gui.html(html.escape(error))
240240

241241
if return_value := gui.session_state.get("return_value"):
242242
gui.write("**Return value**")

widgets/workflow_search.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ def render_search_bar(
7070
search_filters: SearchFilters,
7171
key: str = "search_query",
7272
current_user: AppUser | None = None,
73+
id: str | None = None,
7374
**props,
7475
) -> str:
76+
id = id or f"--search_bar:{key}"
77+
7578
with (
7679
gui.styled(
7780
r"""
@@ -118,11 +121,20 @@ def render_search_bar(
118121
),
119122
key=key,
120123
value=search_filters.search,
124+
id=id,
121125
**props,
122126
)
123127

124128
# add a hidden submit button to allow form submission on pressing Enter
125-
gui.html('<input type="submit" hidden />')
129+
gui.button(
130+
"",
131+
className="m-0 p-0",
132+
hidden=True,
133+
onClick=f"""
134+
event.preventDefault();
135+
document.getElementById("{id}").blur();
136+
""",
137+
)
126138

127139
if search_query and gui.button(
128140
icons.cancel, type="link", className="clear_button"

0 commit comments

Comments
 (0)