Spaces:
Running
Running
Commit
•
626b143
1
Parent(s):
53ef178
fix for story generation
Browse files
Dockerfile
CHANGED
@@ -50,7 +50,8 @@ COPY --chown=user . /app
|
|
50 |
|
51 |
RUN npm ci --force
|
52 |
|
53 |
-
# expose our secrets during build
|
|
|
54 |
RUN --mount=type=secret,id=UPSTASH_REDIS_REST_TOKEN,mode=0444,required=true \
|
55 |
--mount=type=secret,id=UPSTASH_REDIS_REST_URL,mode=0444,required=true \
|
56 |
UPSTASH_REDIS_REST_TOKEN=$(cat /run/secrets/UPSTASH_REDIS_REST_TOKEN) \
|
|
|
50 |
|
51 |
RUN npm ci --force
|
52 |
|
53 |
+
# expose our secrets during the static build
|
54 |
+
# otherwise Upstash becomes unhappy
|
55 |
RUN --mount=type=secret,id=UPSTASH_REDIS_REST_TOKEN,mode=0444,required=true \
|
56 |
--mount=type=secret,id=UPSTASH_REDIS_REST_URL,mode=0444,required=true \
|
57 |
UPSTASH_REDIS_REST_TOKEN=$(cat /run/secrets/UPSTASH_REDIS_REST_TOKEN) \
|
package-lock.json
CHANGED
@@ -8,9 +8,9 @@
|
|
8 |
"name": "@aitube/website",
|
9 |
"version": "0.0.0",
|
10 |
"dependencies": {
|
11 |
-
"@aitube/clap": "0.0.
|
12 |
-
"@aitube/client": "0.0.
|
13 |
-
"@aitube/engine": "0.0.
|
14 |
"@huggingface/hub": "0.12.3-oauth",
|
15 |
"@huggingface/inference": "^2.7.0",
|
16 |
"@jcoreio/async-throttle": "^1.6.0",
|
@@ -119,9 +119,9 @@
|
|
119 |
}
|
120 |
},
|
121 |
"node_modules/@aitube/clap": {
|
122 |
-
"version": "0.0.
|
123 |
-
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.
|
124 |
-
"integrity": "sha512-
|
125 |
"dependencies": {
|
126 |
"pure-uuid": "^1.8.1",
|
127 |
"yaml": "^2.4.2"
|
@@ -131,22 +131,22 @@
|
|
131 |
}
|
132 |
},
|
133 |
"node_modules/@aitube/client": {
|
134 |
-
"version": "0.0.
|
135 |
-
"resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.
|
136 |
-
"integrity": "sha512-
|
137 |
"dependencies": {
|
138 |
"query-string": "^9.0.0"
|
139 |
},
|
140 |
"peerDependencies": {
|
141 |
-
"@aitube/clap": "0.0.
|
142 |
}
|
143 |
},
|
144 |
"node_modules/@aitube/engine": {
|
145 |
-
"version": "0.0.
|
146 |
-
"resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.
|
147 |
-
"integrity": "sha512-
|
148 |
"peerDependencies": {
|
149 |
-
"@aitube/clap": "0.0.
|
150 |
}
|
151 |
},
|
152 |
"node_modules/@alloc/quick-lru": {
|
@@ -3322,6 +3322,17 @@
|
|
3322 |
"node": ">= 8"
|
3323 |
}
|
3324 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3325 |
"node_modules/arg": {
|
3326 |
"version": "5.0.2",
|
3327 |
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
|
@@ -3583,9 +3594,9 @@
|
|
3583 |
}
|
3584 |
},
|
3585 |
"node_modules/axios": {
|
3586 |
-
"version": "1.7.
|
3587 |
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.
|
3588 |
-
"integrity": "sha512
|
3589 |
"dependencies": {
|
3590 |
"follow-redirects": "^1.15.6",
|
3591 |
"form-data": "^4.0.0",
|
@@ -3641,11 +3652,11 @@
|
|
3641 |
}
|
3642 |
},
|
3643 |
"node_modules/braces": {
|
3644 |
-
"version": "3.0.
|
3645 |
-
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.
|
3646 |
-
"integrity": "sha512-
|
3647 |
"dependencies": {
|
3648 |
-
"fill-range": "^7.
|
3649 |
},
|
3650 |
"engines": {
|
3651 |
"node": ">=8"
|
@@ -4332,9 +4343,9 @@
|
|
4332 |
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
|
4333 |
},
|
4334 |
"node_modules/electron-to-chromium": {
|
4335 |
-
"version": "1.4.
|
4336 |
-
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.
|
4337 |
-
"integrity": "sha512-
|
4338 |
},
|
4339 |
"node_modules/elliptic": {
|
4340 |
"version": "6.5.4",
|
@@ -5107,9 +5118,9 @@
|
|
5107 |
}
|
5108 |
},
|
5109 |
"node_modules/fill-range": {
|
5110 |
-
"version": "7.
|
5111 |
-
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.
|
5112 |
-
"integrity": "sha512-
|
5113 |
"dependencies": {
|
5114 |
"to-regex-range": "^5.0.1"
|
5115 |
},
|
@@ -6070,9 +6081,9 @@
|
|
6070 |
}
|
6071 |
},
|
6072 |
"node_modules/jackspeak": {
|
6073 |
-
"version": "
|
6074 |
-
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-
|
6075 |
-
"integrity": "sha512-
|
6076 |
"dependencies": {
|
6077 |
"@isaacs/cliui": "^8.0.2"
|
6078 |
},
|
@@ -6177,9 +6188,9 @@
|
|
6177 |
}
|
6178 |
},
|
6179 |
"node_modules/language-subtag-registry": {
|
6180 |
-
"version": "0.3.
|
6181 |
-
"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.
|
6182 |
-
"integrity": "sha512-
|
6183 |
},
|
6184 |
"node_modules/language-tags": {
|
6185 |
"version": "1.0.9",
|
@@ -6314,12 +6325,12 @@
|
|
6314 |
}
|
6315 |
},
|
6316 |
"node_modules/micromatch": {
|
6317 |
-
"version": "4.0.
|
6318 |
-
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.
|
6319 |
-
"integrity": "sha512-
|
6320 |
"dependencies": {
|
6321 |
-
"braces": "^3.0.
|
6322 |
-
"picomatch": "^
|
6323 |
},
|
6324 |
"engines": {
|
6325 |
"node": ">=8.6"
|
@@ -6865,11 +6876,11 @@
|
|
6865 |
"integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew=="
|
6866 |
},
|
6867 |
"node_modules/picomatch": {
|
6868 |
-
"version": "
|
6869 |
-
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-
|
6870 |
-
"integrity": "sha512-
|
6871 |
"engines": {
|
6872 |
-
"node": ">=
|
6873 |
},
|
6874 |
"funding": {
|
6875 |
"url": "https://github.com/sponsors/jonschlinkert"
|
@@ -7369,6 +7380,17 @@
|
|
7369 |
"node": ">=8.10.0"
|
7370 |
}
|
7371 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7372 |
"node_modules/reflect.getprototypeof": {
|
7373 |
"version": "1.0.6",
|
7374 |
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz",
|
@@ -8019,12 +8041,12 @@
|
|
8019 |
}
|
8020 |
},
|
8021 |
"node_modules/sucrase/node_modules/glob": {
|
8022 |
-
"version": "10.3.
|
8023 |
-
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.
|
8024 |
-
"integrity": "sha512-
|
8025 |
"dependencies": {
|
8026 |
"foreground-child": "^3.1.0",
|
8027 |
-
"jackspeak": "^
|
8028 |
"minimatch": "^9.0.1",
|
8029 |
"minipass": "^7.0.4",
|
8030 |
"path-scurry": "^1.11.0"
|
|
|
8 |
"name": "@aitube/website",
|
9 |
"version": "0.0.0",
|
10 |
"dependencies": {
|
11 |
+
"@aitube/clap": "0.0.20",
|
12 |
+
"@aitube/client": "0.0.29",
|
13 |
+
"@aitube/engine": "0.0.11",
|
14 |
"@huggingface/hub": "0.12.3-oauth",
|
15 |
"@huggingface/inference": "^2.7.0",
|
16 |
"@jcoreio/async-throttle": "^1.6.0",
|
|
|
119 |
}
|
120 |
},
|
121 |
"node_modules/@aitube/clap": {
|
122 |
+
"version": "0.0.20",
|
123 |
+
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.20.tgz",
|
124 |
+
"integrity": "sha512-QOEl3GTHRpaBtKGYoH+iabY9TfLYogOoIfc/YuwC01paO/woMASccjDloPGiPe9C0/P88AqB6s7bN3Dkz1v0TQ==",
|
125 |
"dependencies": {
|
126 |
"pure-uuid": "^1.8.1",
|
127 |
"yaml": "^2.4.2"
|
|
|
131 |
}
|
132 |
},
|
133 |
"node_modules/@aitube/client": {
|
134 |
+
"version": "0.0.29",
|
135 |
+
"resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.29.tgz",
|
136 |
+
"integrity": "sha512-7ASbsoKuk10RbF/d9uuGU2OBnMxrLd/O01rSH5GUYMTeWnJNjnEBy/klgCQxoA7qrO6VX7kJGI5MB2pfK9XJFA==",
|
137 |
"dependencies": {
|
138 |
"query-string": "^9.0.0"
|
139 |
},
|
140 |
"peerDependencies": {
|
141 |
+
"@aitube/clap": "0.0.20"
|
142 |
}
|
143 |
},
|
144 |
"node_modules/@aitube/engine": {
|
145 |
+
"version": "0.0.11",
|
146 |
+
"resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.11.tgz",
|
147 |
+
"integrity": "sha512-XMjhyakLvYvEmJFlJVWIdxymDhpAcW9RnZfGXNCsCPrjkrb6nhuVm3RDSRO2JwNPe/i7T4DaEDVeWavDiyQNMA==",
|
148 |
"peerDependencies": {
|
149 |
+
"@aitube/clap": "0.0.20"
|
150 |
}
|
151 |
},
|
152 |
"node_modules/@alloc/quick-lru": {
|
|
|
3322 |
"node": ">= 8"
|
3323 |
}
|
3324 |
},
|
3325 |
+
"node_modules/anymatch/node_modules/picomatch": {
|
3326 |
+
"version": "2.3.1",
|
3327 |
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
3328 |
+
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
3329 |
+
"engines": {
|
3330 |
+
"node": ">=8.6"
|
3331 |
+
},
|
3332 |
+
"funding": {
|
3333 |
+
"url": "https://github.com/sponsors/jonschlinkert"
|
3334 |
+
}
|
3335 |
+
},
|
3336 |
"node_modules/arg": {
|
3337 |
"version": "5.0.2",
|
3338 |
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
|
|
|
3594 |
}
|
3595 |
},
|
3596 |
"node_modules/axios": {
|
3597 |
+
"version": "1.7.2",
|
3598 |
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz",
|
3599 |
+
"integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==",
|
3600 |
"dependencies": {
|
3601 |
"follow-redirects": "^1.15.6",
|
3602 |
"form-data": "^4.0.0",
|
|
|
3652 |
}
|
3653 |
},
|
3654 |
"node_modules/braces": {
|
3655 |
+
"version": "3.0.3",
|
3656 |
+
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
3657 |
+
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
3658 |
"dependencies": {
|
3659 |
+
"fill-range": "^7.1.1"
|
3660 |
},
|
3661 |
"engines": {
|
3662 |
"node": ">=8"
|
|
|
4343 |
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
|
4344 |
},
|
4345 |
"node_modules/electron-to-chromium": {
|
4346 |
+
"version": "1.4.777",
|
4347 |
+
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.777.tgz",
|
4348 |
+
"integrity": "sha512-n02NCwLJ3wexLfK/yQeqfywCblZqLcXphzmid5e8yVPdtEcida7li0A5WQKghHNG0FeOMCzeFOzEbtAh5riXFw=="
|
4349 |
},
|
4350 |
"node_modules/elliptic": {
|
4351 |
"version": "6.5.4",
|
|
|
5118 |
}
|
5119 |
},
|
5120 |
"node_modules/fill-range": {
|
5121 |
+
"version": "7.1.1",
|
5122 |
+
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
5123 |
+
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
5124 |
"dependencies": {
|
5125 |
"to-regex-range": "^5.0.1"
|
5126 |
},
|
|
|
6081 |
}
|
6082 |
},
|
6083 |
"node_modules/jackspeak": {
|
6084 |
+
"version": "3.1.2",
|
6085 |
+
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz",
|
6086 |
+
"integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==",
|
6087 |
"dependencies": {
|
6088 |
"@isaacs/cliui": "^8.0.2"
|
6089 |
},
|
|
|
6188 |
}
|
6189 |
},
|
6190 |
"node_modules/language-subtag-registry": {
|
6191 |
+
"version": "0.3.23",
|
6192 |
+
"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz",
|
6193 |
+
"integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ=="
|
6194 |
},
|
6195 |
"node_modules/language-tags": {
|
6196 |
"version": "1.0.9",
|
|
|
6325 |
}
|
6326 |
},
|
6327 |
"node_modules/micromatch": {
|
6328 |
+
"version": "4.0.6",
|
6329 |
+
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.6.tgz",
|
6330 |
+
"integrity": "sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ==",
|
6331 |
"dependencies": {
|
6332 |
+
"braces": "^3.0.3",
|
6333 |
+
"picomatch": "^4.0.2"
|
6334 |
},
|
6335 |
"engines": {
|
6336 |
"node": ">=8.6"
|
|
|
6876 |
"integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew=="
|
6877 |
},
|
6878 |
"node_modules/picomatch": {
|
6879 |
+
"version": "4.0.2",
|
6880 |
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
|
6881 |
+
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
6882 |
"engines": {
|
6883 |
+
"node": ">=12"
|
6884 |
},
|
6885 |
"funding": {
|
6886 |
"url": "https://github.com/sponsors/jonschlinkert"
|
|
|
7380 |
"node": ">=8.10.0"
|
7381 |
}
|
7382 |
},
|
7383 |
+
"node_modules/readdirp/node_modules/picomatch": {
|
7384 |
+
"version": "2.3.1",
|
7385 |
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
7386 |
+
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
7387 |
+
"engines": {
|
7388 |
+
"node": ">=8.6"
|
7389 |
+
},
|
7390 |
+
"funding": {
|
7391 |
+
"url": "https://github.com/sponsors/jonschlinkert"
|
7392 |
+
}
|
7393 |
+
},
|
7394 |
"node_modules/reflect.getprototypeof": {
|
7395 |
"version": "1.0.6",
|
7396 |
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz",
|
|
|
8041 |
}
|
8042 |
},
|
8043 |
"node_modules/sucrase/node_modules/glob": {
|
8044 |
+
"version": "10.3.16",
|
8045 |
+
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz",
|
8046 |
+
"integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==",
|
8047 |
"dependencies": {
|
8048 |
"foreground-child": "^3.1.0",
|
8049 |
+
"jackspeak": "^3.1.2",
|
8050 |
"minimatch": "^9.0.1",
|
8051 |
"minipass": "^7.0.4",
|
8052 |
"path-scurry": "^1.11.0"
|
package.json
CHANGED
@@ -10,9 +10,9 @@
|
|
10 |
"lint": "next lint"
|
11 |
},
|
12 |
"dependencies": {
|
13 |
-
"@aitube/clap": "0.0.
|
14 |
-
"@aitube/client": "0.0.
|
15 |
-
"@aitube/engine": "0.0.
|
16 |
"@huggingface/hub": "0.12.3-oauth",
|
17 |
"@huggingface/inference": "^2.7.0",
|
18 |
"@jcoreio/async-throttle": "^1.6.0",
|
|
|
10 |
"lint": "next lint"
|
11 |
},
|
12 |
"dependencies": {
|
13 |
+
"@aitube/clap": "0.0.20",
|
14 |
+
"@aitube/client": "0.0.29",
|
15 |
+
"@aitube/engine": "0.0.11",
|
16 |
"@huggingface/hub": "0.12.3-oauth",
|
17 |
"@huggingface/inference": "^2.7.0",
|
18 |
"@jcoreio/async-throttle": "^1.6.0",
|
src/app/api/parsers/parsePrompt.ts
CHANGED
@@ -4,6 +4,6 @@ export function parsePrompt(input?: any) {
|
|
4 |
res = decodeURIComponent(`${input || ""}` || "").trim()
|
5 |
} catch (err) {}
|
6 |
|
7 |
-
if (!
|
8 |
return res
|
9 |
}
|
|
|
4 |
res = decodeURIComponent(`${input || ""}` || "").trim()
|
5 |
} catch (err) {}
|
6 |
|
7 |
+
if (!res.length) { throw new Error(`please provide a prompt`) }
|
8 |
return res
|
9 |
}
|
src/app/api/v1/edit/story/extendLatentStoryWithMoreShots.ts
CHANGED
@@ -38,10 +38,13 @@ export async function extendLatentStoryWithMoreShots({
|
|
38 |
|
39 |
let initialStory = YAML.stringify(
|
40 |
// we need to help the LLM by marking the shots with a simple numeric ID
|
41 |
-
latentStory.map((shot, i) => ({
|
42 |
-
|
43 |
-
|
44 |
-
}))
|
|
|
|
|
|
|
45 |
)
|
46 |
|
47 |
let compressedStory = initialStory
|
|
|
38 |
|
39 |
let initialStory = YAML.stringify(
|
40 |
// we need to help the LLM by marking the shots with a simple numeric ID
|
41 |
+
// latentStory.map((shot, i) => ({
|
42 |
+
// shot: i,
|
43 |
+
// ...shot,
|
44 |
+
// }))
|
45 |
+
|
46 |
+
// ..well no, actually we don't!
|
47 |
+
latentStory
|
48 |
)
|
49 |
|
50 |
let compressedStory = initialStory
|
src/app/api/v1/edit/story/systemPromptExtendStory.ts
CHANGED
@@ -28,7 +28,7 @@ number of shots to extend: 3
|
|
28 |
|
29 |
\`\`\`yaml
|
30 |
- comment: "A messenger comes to the royal court, with an urgent message."
|
31 |
-
image: "Establishing shot of ROYAL MESSENGER dressed in medieval horse rider and light scout attire, entering the royal court, kneeling in
|
32 |
voice: "Sire, enemy troups will be here by sunrise. What thou you order?"
|
33 |
\`\`\
|
34 |
|
|
|
28 |
|
29 |
\`\`\`yaml
|
30 |
- comment: "A messenger comes to the royal court, with an urgent message."
|
31 |
+
image: "Establishing shot of ROYAL MESSENGER dressed in medieval horse rider and light scout attire, entering the royal court, kneeling in front of KING ARTHUS, a majestic king, dressed in golden armor and a purple cape."
|
32 |
voice: "Sire, enemy troups will be here by sunrise. What thou you order?"
|
33 |
\`\`\
|
34 |
|