Minor fixes

This commit is contained in:
oobabooga
2026-05-20 11:37:45 -07:00
parent 79b46b80ec
commit f9df9be982
2 changed files with 3 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ def _render_web_search_body(body):
for r in results:
title = html.escape(r['title'])
url = r['url']
snippet = html.escape(r.get('snippet', ''))
snippet = html.escape(r.get('snippet') or '')
if url.lower().startswith(('http://', 'https://')):
link = f'<a class="web-search-title" href="{html.escape(url)}" target="_blank" rel="noopener noreferrer">{title}</a>'
else:

View File

@@ -211,7 +211,8 @@ def is_mmproj_file(name):
def find_sibling_mmproj(model_path):
"""Return an mmproj path relative to model_dir when exactly one mmproj file
sits next to the model in a subfolder of model_dir (any depth, not root).
sits in the same folder as the model, provided that folder is a subfolder
of model_dir (not model_dir itself).
"""
try:
model_path = Path(model_path)