Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test New LLMs (Llama2, CodeLlama, etc.) on Chat-UI? #1

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
df5a2eb
Fix typo in Settings.ts (#286)
eltociear Jun 9, 2023
abe7804
Fixed grammar (#291)
CAPTAIN320 Jun 13, 2023
5d07536
Added ChatUI branding & put theming behind an env variable (#298)
nsarrazin Jun 16, 2023
0dace21
➕ Update README.md to Include endpoints Variable (#288)
averad Jun 19, 2023
f567f41
Fix code example preview (#300)
arifszn Jun 19, 2023
e34af36
Fix README linting & add details about auth
nsarrazin Jun 19, 2023
7457e8c
add a readme section about theming
nsarrazin Jun 20, 2023
6f7b315
Added Serper.dev API as an alternative web search provider (#302)
rogerserper Jun 20, 2023
b46dc11
add details about websearch to README
nsarrazin Jun 20, 2023
922b1b2
very basic rate limiter (#320)
nsarrazin Jun 23, 2023
0aa57de
Add support for websearch retries (#318)
nsarrazin Jun 26, 2023
fb55900
loader dots fix
gary149 Jul 6, 2023
3baa389
feat: factor out HF_API_ROOT to allow different inference endpoints (…
DayOfThePenguin Jul 11, 2023
10d1ab5
Add support for HF summarization endpoint in the websearch (#319)
nsarrazin Jul 11, 2023
1eff97d
Add optional timestamps to messages (#294)
nsarrazin Jul 12, 2023
ce2231f
Add ability to define custom model/dataset URLs (#347)
secondtruth Jul 17, 2023
b3411af
Added Docker Space deployment docs (#350)
merveenoyan Jul 18, 2023
a38cbb5
bump version to 0.4 (#353)
nsarrazin Jul 19, 2023
479dbfa
Update README.md (#354)
merveenoyan Jul 19, 2023
6183fe7
Option to disable login on first N messages (#352)
nsarrazin Jul 19, 2023
0a662b7
Revert "Option to disable login on first N messages (#352)"
gary149 Jul 19, 2023
7767757
support rate limiting based on user IP (#342)
nsarrazin Jul 20, 2023
7c4fdc9
Reopen: Feature/disable login for n messages (#356)
gary149 Jul 20, 2023
ac291a6
Revert "support rate limiting based on user IP (#342)"
nsarrazin Jul 20, 2023
569bde3
Update README.md (#359)
osanseviero Jul 20, 2023
a935f0a
Added access token note (#360)
merveenoyan Jul 28, 2023
7dd8724
Update /privacy and other content following Llama v2 release (#374)
julien-c Jul 28, 2023
19db9db
Clarify that model 'tokens' are not actual tokens (#367)
AndreasMadsen Jul 28, 2023
932ee7e
Attempt to clarify how hosted API ≠ local endpoint (#373)
julien-c Jul 28, 2023
54e8a52
Make model branding customizable based on env var (#345)
flozi00 Aug 1, 2023
d2a650e
trim and remove stop-suffixes from summary (#369)
AndreasMadsen Aug 2, 2023
8fa7bd9
add a login button when users are logged out (#381)
nsarrazin Aug 2, 2023
f209301
allow different user and assistant end-token (#375)
AndreasMadsen Aug 2, 2023
0ad340e
Leverage model link to modelUrl when informed (#385)
airibarne Aug 3, 2023
49caedf
Update README.md
krrishdholakia Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for HF summarization endpoint in the websearch (huggingfa…
…ce#319)

* Add support for HF endpoint for summary

* add fail-safe for summarization
  • Loading branch information
nsarrazin committed Jul 11, 2023
commit 10d1ab5d3b20a7f592314e68673273e043622a70
21 changes: 21 additions & 0 deletions src/lib/server/websearch/summarizeWeb.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
import { HF_ACCESS_TOKEN } from "$env/static/private";
import { HfInference } from "@huggingface/inference";
import { generateFromDefaultEndpoint } from "../generateFromDefaultEndpoint";
import type { BackendModel } from "../models";

export async function summarizeWeb(content: string, query: string, model: BackendModel) {
// if HF_ACCESS_TOKEN is set, we use a HF dedicated endpoint for summarization
try {
if (HF_ACCESS_TOKEN) {
const summary = (
await new HfInference(HF_ACCESS_TOKEN).summarization({
model: "facebook/bart-large-cnn",
inputs: content,
parameters: {
max_length: 512,
},
})
).summary_text;
return summary;
}
} catch (e) {
console.log(e);
}

// else we use the LLM to generate a summary
const summaryPrompt =
model.userMessageToken +
content
Expand Down