Spaces:
Sleeping
Sleeping
update
Browse files- .dockerignore +8 -0
- .env +80 -0
- .env.local +5 -0
- .eslintignore +13 -0
- .eslintrc.cjs +43 -0
- .npmrc +1 -0
- .prettierignore +13 -0
- .prettierrc +8 -0
.dockerignore
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Dockerfile
|
2 |
+
.vscode/
|
3 |
+
.idea
|
4 |
+
.gitignore
|
5 |
+
LICENSE
|
6 |
+
README.md
|
7 |
+
node_modules/
|
8 |
+
.svelte-kit/
|
.env
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use .env.local to change these variables
|
2 |
+
# DO NOT EDIT THIS FILE WITH SENSITIVE DATA
|
3 |
+
|
4 |
+
MONGODB_URL=#your mongodb URL here
|
5 |
+
MONGODB_DB_NAME=chat-ui
|
6 |
+
MONGODB_DIRECT_CONNECTION=false
|
7 |
+
|
8 |
+
COOKIE_NAME=blindchat
|
9 |
+
HF_ACCESS_TOKEN=#hf_<token> from from https://huggingface.co/settings/token
|
10 |
+
HF_API_ROOT=https://api-inference.huggingface.co/models
|
11 |
+
|
12 |
+
# used to activate search with web functionality. disabled if none are defined. choose one of the following:
|
13 |
+
SERPER_API_KEY=#your serper.dev api key here
|
14 |
+
SERPAPI_KEY=#your serpapi key here
|
15 |
+
|
16 |
+
# Parameters to enable "Sign in with HF"
|
17 |
+
OPENID_CLIENT_ID=
|
18 |
+
OPENID_CLIENT_SECRET=
|
19 |
+
OPENID_SCOPES="openid profile" # Add "email" for some providers like Google that do not provide preferred_username
|
20 |
+
OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.google.com
|
21 |
+
|
22 |
+
# Parameters to enable a global mTLS context for client fetch requests
|
23 |
+
USE_CLIENT_CERTIFICATE=false
|
24 |
+
CERT_PATH=#
|
25 |
+
KEY_PATH=#
|
26 |
+
CA_PATH=#
|
27 |
+
CLIENT_KEY_PASSWORD=#
|
28 |
+
REJECT_UNAUTHORIZED=true
|
29 |
+
|
30 |
+
# 'name', 'userMessageToken', 'assistantMessageToken' are required
|
31 |
+
MODELS=`[
|
32 |
+
{
|
33 |
+
"name": "Xenova/LaMini-Flan-T5-783M",
|
34 |
+
"is_local": true,
|
35 |
+
"userMessageToken": "<|prompter|>",
|
36 |
+
"assistantMessageToken": "<|assistant|>",
|
37 |
+
"messageEndToken": "</s>",
|
38 |
+
"preprompt": "",
|
39 |
+
"promptExamples": [
|
40 |
+
{
|
41 |
+
"title": "What is love?",
|
42 |
+
"prompt": "What is love?"
|
43 |
+
}, {
|
44 |
+
"title": "Who is Ada Lovelace?",
|
45 |
+
"prompt": "Who is Ada Lovelace?"
|
46 |
+
}, {
|
47 |
+
"title": "What does end-to-end protected mean?",
|
48 |
+
"prompt": "What does end-to-end protected mean?"
|
49 |
+
}
|
50 |
+
],
|
51 |
+
"parameters": {
|
52 |
+
"temperature": 0.9,
|
53 |
+
"top_p": 0.95,
|
54 |
+
"repetition_penalty": 1.2,
|
55 |
+
"top_k": 50,
|
56 |
+
"truncate": 1000,
|
57 |
+
"max_new_tokens": 1024
|
58 |
+
}
|
59 |
+
}
|
60 |
+
]`
|
61 |
+
OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`
|
62 |
+
|
63 |
+
PUBLIC_ORIGIN=#https://huggingface.co
|
64 |
+
PUBLIC_SHARE_PREFIX=#https://hf.co/chat
|
65 |
+
PUBLIC_GOOGLE_ANALYTICS_ID=#G-XXXXXXXX / Leave empty to disable
|
66 |
+
PUBLIC_DEPRECATED_GOOGLE_ANALYTICS_ID=#UA-XXXXXXXX-X / Leave empty to disable
|
67 |
+
PUBLIC_ANNOUNCEMENT_BANNERS=`[]`
|
68 |
+
|
69 |
+
PARQUET_EXPORT_DATASET=
|
70 |
+
PARQUET_EXPORT_HF_TOKEN=
|
71 |
+
PARQUET_EXPORT_SECRET=
|
72 |
+
|
73 |
+
RATE_LIMIT= # requests per minute
|
74 |
+
MESSAGES_BEFORE_LOGIN=# how many messages a user can send in a conversation before having to login. set to 0 to force login right away
|
75 |
+
|
76 |
+
PUBLIC_APP_NAME=ChatUI # name used as title throughout the app
|
77 |
+
PUBLIC_APP_ASSETS=chatui # used to find logos & favicons in static/$PUBLIC_APP_ASSETS
|
78 |
+
PUBLIC_APP_COLOR=blue # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
|
79 |
+
PUBLIC_APP_DATA_SHARING=#set to 1 to enable options & text regarding data sharing
|
80 |
+
PUBLIC_APP_DISCLAIMER=#set to 1 to show a disclaimer on login page
|
.env.local
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use .env.local to change these variables
|
2 |
+
# DO NOT EDIT THIS FILE WITH SENSITIVE DATA
|
3 |
+
|
4 |
+
PUBLIC_APP_NAME=BlindChat
|
5 |
+
PUBLIC_APP_DATA_SHARING=false
|
.eslintignore
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
node_modules
|
3 |
+
/build
|
4 |
+
/.svelte-kit
|
5 |
+
/package
|
6 |
+
.env
|
7 |
+
.env.*
|
8 |
+
!.env.example
|
9 |
+
|
10 |
+
# Ignore files for PNPM, NPM and YARN
|
11 |
+
pnpm-lock.yaml
|
12 |
+
package-lock.json
|
13 |
+
yarn.lock
|
.eslintrc.cjs
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
module.exports = {
|
2 |
+
root: true,
|
3 |
+
parser: "@typescript-eslint/parser",
|
4 |
+
extends: [
|
5 |
+
"eslint:recommended",
|
6 |
+
"plugin:@typescript-eslint/recommended",
|
7 |
+
"plugin:svelte/recommended",
|
8 |
+
"prettier",
|
9 |
+
],
|
10 |
+
plugins: ["@typescript-eslint"],
|
11 |
+
ignorePatterns: ["*.cjs"],
|
12 |
+
overrides: [
|
13 |
+
{
|
14 |
+
files: ["*.svelte"],
|
15 |
+
parser: "svelte-eslint-parser",
|
16 |
+
parserOptions: {
|
17 |
+
parser: "@typescript-eslint/parser",
|
18 |
+
},
|
19 |
+
},
|
20 |
+
],
|
21 |
+
parserOptions: {
|
22 |
+
sourceType: "module",
|
23 |
+
ecmaVersion: 2020,
|
24 |
+
extraFileExtensions: [".svelte"],
|
25 |
+
},
|
26 |
+
rules: {
|
27 |
+
"no-shadow": ["error"],
|
28 |
+
"@typescript-eslint/no-explicit-any": "error",
|
29 |
+
"@typescript-eslint/no-non-null-assertion": "error",
|
30 |
+
"@typescript-eslint/no-unused-vars": [
|
31 |
+
// prevent variables with a _ prefix from being marked as unused
|
32 |
+
"error",
|
33 |
+
{
|
34 |
+
argsIgnorePattern: "^_",
|
35 |
+
},
|
36 |
+
],
|
37 |
+
},
|
38 |
+
env: {
|
39 |
+
browser: true,
|
40 |
+
es2017: true,
|
41 |
+
node: true,
|
42 |
+
},
|
43 |
+
};
|
.npmrc
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
engine-strict=true
|
.prettierignore
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
node_modules
|
3 |
+
/build
|
4 |
+
/.svelte-kit
|
5 |
+
/package
|
6 |
+
.env
|
7 |
+
.env.*
|
8 |
+
!.env.example
|
9 |
+
|
10 |
+
# Ignore files for PNPM, NPM and YARN
|
11 |
+
pnpm-lock.yaml
|
12 |
+
package-lock.json
|
13 |
+
yarn.lock
|
.prettierrc
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"useTabs": true,
|
3 |
+
"trailingComma": "es5",
|
4 |
+
"printWidth": 100,
|
5 |
+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
|
6 |
+
"pluginSearchDirs": ["."],
|
7 |
+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
8 |
+
}
|