Spaces:
Runtime error
Runtime error
add MODEL_PROMPT_TEMPLATE to params
Browse files- .env.local.template +1 -3
- Dockerfile +5 -0
- defaults/MODEL_PROMPT_TEMPLATE +1 -0
.env.local.template
CHANGED
@@ -23,9 +23,7 @@ OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.go
|
|
23 |
MODELS=`[
|
24 |
{
|
25 |
"name": "${MODEL_NAME}",
|
26 |
-
"
|
27 |
-
"assistantMessageToken": "<|assistant|>",
|
28 |
-
"messageEndToken": "<|endoftext|>",
|
29 |
"preprompt": "",
|
30 |
"promptExamples": [
|
31 |
{
|
|
|
23 |
MODELS=`[
|
24 |
{
|
25 |
"name": "${MODEL_NAME}",
|
26 |
+
"chatPromptTemplate": "${MODEL_PROMPT_TEMPLATE}",
|
|
|
|
|
27 |
"preprompt": "",
|
28 |
"promptExamples": [
|
29 |
{
|
Dockerfile
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
ARG MODEL_NAME
|
2 |
ARG MODEL_PARAMS
|
|
|
3 |
ARG APP_COLOR
|
4 |
ARG APP_NAME
|
5 |
|
@@ -9,6 +10,7 @@ ARG MODEL_NAME
|
|
9 |
ARG MODEL_PARAMS
|
10 |
ARG APP_COLOR
|
11 |
ARG APP_NAME
|
|
|
12 |
|
13 |
WORKDIR /app
|
14 |
|
@@ -30,6 +32,7 @@ RUN chmod -R 777 /defaults
|
|
30 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
31 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
32 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
|
|
33 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
34 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
35 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
@@ -49,6 +52,7 @@ FROM ghcr.io/huggingface/text-generation-inference:latest
|
|
49 |
|
50 |
ARG MODEL_NAME
|
51 |
ARG MODEL_PARAMS
|
|
|
52 |
ARG APP_COLOR
|
53 |
ARG APP_NAME
|
54 |
|
@@ -71,6 +75,7 @@ RUN chmod -R 777 /defaults
|
|
71 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
72 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
73 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
|
|
74 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
75 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
76 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
|
|
1 |
ARG MODEL_NAME
|
2 |
ARG MODEL_PARAMS
|
3 |
+
ARG MODEL_PROMPT_TEMPLATE
|
4 |
ARG APP_COLOR
|
5 |
ARG APP_NAME
|
6 |
|
|
|
10 |
ARG MODEL_PARAMS
|
11 |
ARG APP_COLOR
|
12 |
ARG APP_NAME
|
13 |
+
ARG MODEL_PROMPT_TEMPLATE
|
14 |
|
15 |
WORKDIR /app
|
16 |
|
|
|
32 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
33 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
34 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
35 |
+
&& MODEL_PROMPT_TEMPLATE="${MODEL_PROMPT_TEMPLATE:="$(cat /defaults/MODEL_PROMPT_TEMPLATE)"}" && export MODEL_PROMPT_TEMPLATE \
|
36 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
37 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
38 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
|
|
52 |
|
53 |
ARG MODEL_NAME
|
54 |
ARG MODEL_PARAMS
|
55 |
+
ARG MODEL_PROMPT_TEMPLATE
|
56 |
ARG APP_COLOR
|
57 |
ARG APP_NAME
|
58 |
|
|
|
75 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
76 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
77 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
78 |
+
&& MODEL_PROMPT_TEMPLATE="${MODEL_PROMPT_TEMPLATE:="$(cat /defaults/MODEL_PROMPT_TEMPLATE)"}" && export MODEL_PROMPT_TEMPLATE \
|
79 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
80 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
81 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
defaults/MODEL_PROMPT_TEMPLATE
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
<s>{{#each messages}}{{#ifUser}}[INST] {{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}} {{content}} [/INST]{{/ifUser}}{{#ifAssistant}}{{content}}</s> {{/ifAssistant}}{{/each}}
|