nsarrazin HF staff commited on
Commit
88118bf
1 Parent(s): 48bc0c5

add defaults to template

Browse files
.template.env.local CHANGED
@@ -1,7 +1,7 @@
1
  # Use .env.local to change these variables
2
  # DO NOT EDIT THIS FILE WITH SENSITIVE DATA
3
 
4
- MONGODB_URL=mongodb://127.0.0.1:27017
5
  MONGODB_DB_NAME=chat-ui
6
  MONGODB_DIRECT_CONNECTION=false
7
 
@@ -26,7 +26,7 @@ MODELS=`[
26
  "userMessageToken": "<|prompter|>",
27
  "assistantMessageToken": "<|assistant|>",
28
  "messageEndToken": "<|endoftext|>",
29
- "preprompt": "${PREPROMPT}",
30
  "promptExamples": [
31
  {
32
  "title": "Python Fibonacci",
@@ -44,14 +44,7 @@ MODELS=`[
44
  "url": "http://127.0.0.1:8080"
45
  }
46
  ],
47
- "parameters": {
48
- "temperature": ${MODEL_TEMPERATURE},
49
- "top_p": 0.95,
50
- "repetition_penalty": 1.2,
51
- "top_k": 50,
52
- "truncate": 1000,
53
- "max_new_tokens": 1024
54
- }
55
  }
56
  ]`
57
  OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`
@@ -71,3 +64,8 @@ PUBLIC_ANNOUNCEMENT_BANNERS=`[
71
  PARQUET_EXPORT_DATASET=
72
  PARQUET_EXPORT_HF_TOKEN=
73
  PARQUET_EXPORT_SECRET=
 
 
 
 
 
 
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
 
 
26
  "userMessageToken": "<|prompter|>",
27
  "assistantMessageToken": "<|assistant|>",
28
  "messageEndToken": "<|endoftext|>",
29
+ "preprompt": "",
30
  "promptExamples": [
31
  {
32
  "title": "Python Fibonacci",
 
44
  "url": "http://127.0.0.1:8080"
45
  }
46
  ],
47
+ "parameters": ${MODEL_PARAMS}
 
 
 
 
 
 
 
48
  }
49
  ]`
50
  OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`
 
64
  PARQUET_EXPORT_DATASET=
65
  PARQUET_EXPORT_HF_TOKEN=
66
  PARQUET_EXPORT_SECRET=
67
+
68
+ PUBLIC_APP_NAME=${APP_NAME} # name used as title throughout the app
69
+ PUBLIC_APP_ASSETS=chatui # used to find logos & favicons in static/$PUBLIC_APP_ASSETS
70
+ PUBLIC_APP_COLOR=${APP_COLOR} # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
71
+ PUBLIC_APP_DATA_SHARING=#set to 1 to enable disclaimers & options about data sharing
Dockerfile CHANGED
@@ -15,18 +15,20 @@ RUN --mount=type=cache,target=/app/.npm \
15
  npm set cache /app/.npm && \
16
  npm ci
17
 
 
18
 
19
  COPY .template.env.local .template.env.local
20
 
21
  RUN --mount=type=secret,id=MODEL_NAME,mode=0444,required=true \
22
- --mount=type=secret,id=PREPROMPT,mode=0444,required=true \
23
- --mount=type=secret,id=MODEL_TEMPERATURE,mode=0444,required=true \
24
- MODEL_NAME=$(cat /run/secrets/MODEL_NAME) \
25
- && PREPROMPT=$(cat /run/secrets/PREPROMPT) \
26
- && MODEL_TEMPERATURE=$(cat /run/secrets/MODEL_TEMPERATURE) \
27
- && export MODEL_NAME \
28
- && export PREPROMPT \
29
- && export MODEL_TEMPERATURE \
 
30
  && envsubst < ".template.env.local" > ".env.local"
31
 
32
 
 
15
  npm set cache /app/.npm && \
16
  npm ci
17
 
18
+ COPY defaults /app/chat-ui/defaults
19
 
20
  COPY .template.env.local .template.env.local
21
 
22
  RUN --mount=type=secret,id=MODEL_NAME,mode=0444,required=true \
23
+ --mount=type=secret,id=MODEL_PARAMS,mode=0444,required=true \
24
+ --mount=type=secret,id=MONGODB_URL,mode=0444,required=true \
25
+ --mount=type=secret,id=APP_COLOR,mode=0444,required=true \
26
+ --mount=type=secret,id=APP_NAME,mode=0444,required=true \
27
+ MODEL_NAME=$(cat /run/secrets/MODEL_NAME || /app/chat-ui/defaults/MODEL_NAME) && export MODEL_NAME \
28
+ && MODEL_PARAMS=$(cat /run/secrets/MODEL_PARAMS || /app/chat-ui/defaults/MODEL_PARAMS) && export MODEL_PARAMS \
29
+ && MONGODB_URL=$(cat /run/secrets/MONGODB_URL || /app/chat-ui/defaults/MONGODB_URL) && export MONGODB_URL \
30
+ && APP_COLOR=$(cat /run/secrets/APP_COLOR || /app/chat-ui/defaults/APP_COLOR) && export APP_COLOR \
31
+ && APP_NAME=$(cat /run/secrets/APP_NAME || /app/chat-ui/defaults/APP_NAME) && export APP_NAME \
32
  && envsubst < ".template.env.local" > ".env.local"
33
 
34
 
defaults/APP_COLOR ADDED
@@ -0,0 +1 @@
 
 
1
+ blue
defaults/APP_NAME ADDED
@@ -0,0 +1 @@
 
 
1
+ ChatUI
defaults/MODEL_NAME ADDED
@@ -0,0 +1 @@
 
 
1
+ OpenAssistant/falcon-7b-sft-top1-696
defaults/MODEL_PARAMS ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "temperature": 0.9,
3
+ "top_p": 0.95,
4
+ "repetition_penalty": 1.2,
5
+ "top_k": 50,
6
+ "truncate": 1000,
7
+ "max_new_tokens": 1024
8
+ }
defaults/MONGODB_URL ADDED
@@ -0,0 +1 @@
 
 
1
+ mongodb://127.0.0.1:27017