johannhartmann
commited on
Commit
•
b68149a
1
Parent(s):
3819a6e
Move to Wiedervereinigung
Browse files- .env.local +71 -0
- defaults/APP_COLOR +1 -1
- defaults/MODEL_NAME +1 -1
- defaults/MODEL_PROMPT_TEMPLATE +1 -1
- entrypoint.sh +23 -0
.env.local
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use .env.local to change these variables
|
2 |
+
# DO NOT EDIT THIS FILE WITH SENSITIVE DATA
|
3 |
+
|
4 |
+
MONGODB_URL=${MONGODB_URL}
|
5 |
+
MONGODB_DB_NAME=chat-ui
|
6 |
+
MONGODB_DIRECT_CONNECTION=false
|
7 |
+
|
8 |
+
|
9 |
+
COOKIE_NAME=chat-ui
|
10 |
+
HF_ACCESS_TOKEN=#hf_<token> from from https://huggingface.co/settings/token
|
11 |
+
|
12 |
+
# used to activate search with web functionality. disabled if not defined
|
13 |
+
SERPAPI_KEY=#your serpapi key here
|
14 |
+
|
15 |
+
# Parameters to enable "Sign in with HF"
|
16 |
+
OPENID_CLIENT_ID=
|
17 |
+
OPENID_CLIENT_SECRET=
|
18 |
+
OPENID_SCOPES="openid profile" # Add "email" for some providers like Google that do not provide preferred_username
|
19 |
+
OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.google.com
|
20 |
+
|
21 |
+
|
22 |
+
# 'name', 'userMessageToken', 'assistantMessageToken' are required
|
23 |
+
MODELS=`[
|
24 |
+
{
|
25 |
+
"name": "${MODEL_NAME}",
|
26 |
+
"chatPromptTemplate": "${MODEL_PROMPT_TEMPLATE}",
|
27 |
+
"preprompt": "",
|
28 |
+
"promptExamples": [
|
29 |
+
{
|
30 |
+
"title": "Python Fibonacci",
|
31 |
+
"prompt": "Wie schreibe ich eine Python Funktion um eine Fibonacci Nummer auszugeben?"
|
32 |
+
}, {
|
33 |
+
"title": "What is a meme?",
|
34 |
+
"prompt": "Was ist ein Meme, und was ist die Geschichte dieses Wortes?"
|
35 |
+
}, {
|
36 |
+
"title": "Regex",
|
37 |
+
"prompt": "Erzeuge eine Regex um Daten aus Logfiles zu extrahieren."
|
38 |
+
}
|
39 |
+
],
|
40 |
+
"endpoints": [
|
41 |
+
{
|
42 |
+
"type": "tgi",
|
43 |
+
"url": "http://127.0.0.1:8080"
|
44 |
+
}
|
45 |
+
],
|
46 |
+
"parameters": ${MODEL_PARAMS}
|
47 |
+
}
|
48 |
+
]`
|
49 |
+
OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`
|
50 |
+
|
51 |
+
PUBLIC_ORIGIN=${SPACE_HOST}
|
52 |
+
PUBLIC_SHARE_PREFIX=${SPACE_HOST}/r
|
53 |
+
PUBLIC_GOOGLE_ANALYTICS_ID=#G-XXXXXXXX / Leave empty to disable
|
54 |
+
PUBLIC_DEPRECATED_GOOGLE_ANALYTICS_ID=#UA-XXXXXXXX-X / Leave empty to disable
|
55 |
+
PUBLIC_ANNOUNCEMENT_BANNERS=`[
|
56 |
+
{
|
57 |
+
"title": "Chat UI is now open sourced on GitHub",
|
58 |
+
"linkTitle": "GitHub repo",
|
59 |
+
"linkHref": "https://github.com/huggingface/chat-ui"
|
60 |
+
}
|
61 |
+
]`
|
62 |
+
|
63 |
+
PARQUET_EXPORT_DATASET=
|
64 |
+
PARQUET_EXPORT_HF_TOKEN=
|
65 |
+
PARQUET_EXPORT_SECRET=
|
66 |
+
|
67 |
+
PUBLIC_APP_NAME=${APP_NAME} # name used as title throughout the app
|
68 |
+
PUBLIC_APP_ASSETS=chatui # used to find logos & favicons in static/$PUBLIC_APP_ASSETS
|
69 |
+
PUBLIC_APP_COLOR=${APP_COLOR} # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
|
70 |
+
PUBLIC_APP_DATA_SHARING=#set to 1 to enable disclaimers & options about data sharing
|
71 |
+
PUBLIC_APP_DATA_DISCLAIMER=#set to 1 to enable disclaimers about model outputs
|
defaults/APP_COLOR
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
|
|
1 |
+
orange
|
defaults/MODEL_NAME
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
|
|
1 |
+
mayflowergmbh/Wiedervereinigung-7b-dpo
|
defaults/MODEL_PROMPT_TEMPLATE
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
|
|
1 |
+
{{#if @root.preprompt}}<|im_start|>system\n{{@root.preprompt}}<|im_end|>\n{{/if}}{{#each messages}}{{#ifUser}}<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n{{/ifUser}}{{#ifAssistant}}{{content}}<|im_end|>\n{{/ifAssistant}}{{/each}}
|
entrypoint.sh
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# Make sure `/data/db` directory exists even with persistent storage
|
4 |
+
mkdir -p /data/db
|
5 |
+
# If app crashed, mongo didn't stop gracefully. Remove all the old *.lock files
|
6 |
+
find /data/db -name "*.lock" -type f -exec rm -f {} \;
|
7 |
+
# Start the local Mongo database
|
8 |
+
mongod &
|
9 |
+
|
10 |
+
# Start the text-generation-inference process
|
11 |
+
text-generation-launcher --model-id ${MODEL_NAME} --num-shard 1 --port 8080 --trust-remote-code &
|
12 |
+
|
13 |
+
# Wait for text-generation-inference to start
|
14 |
+
curl --retry 60 --retry-delay 10 --retry-connrefused http://127.0.0.1:8080/health
|
15 |
+
|
16 |
+
# Start the chat-ui process
|
17 |
+
pm2 start /app/build/index.js -i $CPU_CORES --no-daemon &
|
18 |
+
|
19 |
+
# Wait for any process to exit
|
20 |
+
wait -n
|
21 |
+
|
22 |
+
# Exit with status of process that exited first
|
23 |
+
exit $?
|