Skip to content

Commit

Permalink
Update README.md (#435)
Browse files Browse the repository at this point in the history
* Update README.md

* add description of websearch on readme

* Apply suggestions from code review

Co-authored-by: Victor Muštar <[email protected]>

* Update README.md

---------

Co-authored-by: Mishig Davaadorj <[email protected]>
Co-authored-by: Mishig <[email protected]>
  • Loading branch information
3 people authored Sep 13, 2023
1 parent e5afba2 commit 8e300b6
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ app_port: 3000

# Chat UI

![Chat UI repository thumbnail](https://huggingface.co/datasets/huggingface/documentation-images/raw/f038917dd40d711a72d654ab1abfc03ae9f177e6/chat-ui-repo-thumbnail.svg)
![Chat UI repository thumbnail](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/chatui-websearch.png)

A chat interface using open source models, eg OpenAssistant or Llama. It is a SvelteKit app and it powers the [HuggingChat app on hf.co/chat](https://huggingface.co/chat).

0. [No Setup Deploy](#no-setup-deploy)
1. [Setup](#setup)
2. [Launch](#launch)
3. [Extra parameters](#extra-parameters)
4. [Deploying to a HF Space](#deploying-to-a-hf-space)
5. [Building](#building)
3. [Web Search](#web-search)
4. [Extra parameters](#extra-parameters)
5. [Deploying to a HF Space](#deploying-to-a-hf-space)
6. [Building](#building)

##  No Setup Deploy

Expand Down Expand Up @@ -70,6 +71,16 @@ npm install
npm run dev
```

## Web Search

Chat UI features a powerful Web Search feature. It works by:

1. Generating an appropriate Google query from the user prompt.
2. Performing Google search and extracting content from webpages.
3. Creating embeddings from texts using [transformers.js](https://huggingface.co/docs/transformers.js). Specifically, using [Xenova/e5-small-v2](https://huggingface.co/Xenova/e5-small-v2) model.
4. From these embeddings, find the ones that are closest to the user query using vector similarity search. Specifically, we use `inner product` distance.
5. Get the corresponding texts to those closest embeddings and perform [Retrieval-Augmented Generation](https://huggingface.co/papers/2005.11401) (i.e. expand user prompt by adding those texts so that a LLM can use this information).

## Extra parameters

### OpenID connect
Expand Down

0 comments on commit 8e300b6

Please sign in to comment.