Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Integration:  git github
Nathan Sarrazin 2d84229d90
prettier
2 years ago
d9a878ffc9
✅ Add tests setup + test sign in flow
2 years ago
fa72efab1e
migrate to eslint-plugin-svelte from deprecated plugin (#182)
2 years ago
src
2d84229d90
prettier
2 years ago
55a1bbcaf2
added svg favicon (#205)
2 years ago
767afa76dc
🐛 Fix "signin with HF" within space + CSRF (#236)
2 years ago
2 years ago
5ed4c3b8f4
error on unused vars instead of warn
2 years ago
2 years ago
2 years ago
2 years ago
b2387f62c8
Add tailwind prettier (#123)
2 years ago
f177e4b330
Simpler dockerfile (#126)
2 years ago
9dccef9d4c
Create LICENSE (#194)
2 years ago
0c599d2e0f
Bump to `v0.2` (#229)
2 years ago
31ef570295
Update documentation on local inference
2 years ago
767afa76dc
🐛 Fix "signin with HF" within space + CSRF (#236)
2 years ago
d9a878ffc9
✅ Add tests setup + test sign in flow
2 years ago
640dc148af
🚨 Run prettier
2 years ago
767afa76dc
🐛 Fix "signin with HF" within space + CSRF (#236)
2 years ago
2606ddec3a
Models selector (#164)
2 years ago
9c038aa1d0
Polyfill safari 14 (#149)
2 years ago
5da61b4a5e
Prettier update (#54)
2 years ago
Storage Buckets

README.md

You have to be logged in to leave a comment. Sign In
title emoji colorFrom colorTo sdk pinned license base_path app_port
chat-ui 🔥 purple purple docker false apache-2.0 /chat 3000

Chat UI

Chat UI repository thumbnail

A chat interface using open source models, eg OpenAssistant. It is a SvelteKit app and it powers the HuggingChat app on hf.co/chat.

Launch

npm install
npm run dev

Environment

Default configuration is in .env. Put custom config and secrets in .env.local, it will override the values in .env.

Check out .env to see what needs to be set.

Basically you need to create a .env.local with the following contents:

MONGODB_URL=<url to mongo, for example a free MongoDB Atlas sandbox instance>
HF_ACCESS_TOKEN=<your HF access token from https://huggingface.co/settings/tokens>

Duplicating to a Space

Create a DOTENV_LOCAL secret to your space with the following contents:

MONGODB_URL=<url to mongo, for example a free MongoDB Atlas sandbox instance>
HF_ACCESS_TOKEN=<your HF access token from https://huggingface.co/settings/tokens>

Where the contents in <...> are replaced by the MongoDB URL and your HF Access Token.

Running Local Inference

Both the example above use the HF Inference API or HF Endpoints API.

If you want to run the model locally, you need to run this inference server locally: https://github.com/huggingface/text-generation-inference

And add this to your .env.local, feel free to adjust/remove the parameters and the preprompt:

MODELS=`[{
  "name": "...",
  "endpoints": [{"url": "http://127.0.0.1:8080/generate_stream"}],
  "userMessageToken": "<|prompter|>",
  "assistantMessageToken": "<|assistant|>",
  "messageEndToken": "</s>",
  "preprompt": "Below are a series of dialogues between various people and an AI assistant. The AI tries to be helpful, polite, honest, sophisticated, emotionally aware, and humble-but-knowledgeable. The assistant is happy to help with almost anything, and will do its best to understand exactly what is needed. It also tries to avoid giving false or misleading information, and it caveats when it isn't entirely sure about the right answer. That said, the assistant is practical and really does its best, and doesn't let caution get too much in the way of being useful.\n-----\n",
  "parameters": {
    "temperature": 0.9,
    "top_p": 0.95,
    "repetition_penalty": 1.2,
    "top_k": 50,
    "truncate": 1000,
    "max_new_tokens": 1000
  }
}]`

Building

To create a production version of your app:

npm run build

You can preview the production build with npm run preview.

To deploy your app, you may need to install an adapter for your target environment.

Tip!

Press p or to see the previous file or, n or to see the next file

About

Open source codebase powering the HuggingChat app

Collaborators 1

Comments

Loading...