mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
updated lite
This commit is contained in:
parent
2de1975ca2
commit
5451a8e8a9
2 changed files with 139 additions and 35 deletions
170
klite.embd
170
klite.embd
File diff suppressed because one or more lines are too long
|
@ -1378,11 +1378,11 @@ def websearch(query):
|
||||||
if matches.size > 100 and desclen-matches.size < 50: #good enough match
|
if matches.size > 100 and desclen-matches.size < 50: #good enough match
|
||||||
# expand description by some chars both sides
|
# expand description by some chars both sides
|
||||||
expandamtbefore = 250
|
expandamtbefore = 250
|
||||||
expandamtafter = 600
|
expandamtafter = 750
|
||||||
startpt = matches.a - expandamtbefore
|
startpt = matches.a - expandamtbefore
|
||||||
startpt = 0 if startpt < 0 else startpt
|
startpt = 0 if startpt < 0 else startpt
|
||||||
endpt = matches.a + expandamtafter + desclen
|
endpt = matches.a + expandamtafter + desclen
|
||||||
pagedesc = scraped[startpt:endpt]
|
pagedesc = scraped[startpt:endpt].strip()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
searchresults.append({"title":title,"url":url,"desc":desc,"content":pagedesc})
|
searchresults.append({"title":title,"url":url,"desc":desc,"content":pagedesc})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue