Commit
·
36f130e
1
Parent(s):
fa9544d
added a clarification about which machine you need
Browse files- README.md +6 -1
- src/index.mts +8 -2
README.md
CHANGED
@@ -69,4 +69,9 @@ You will see the following error message because Docker won't be able to use the
|
|
69 |
|
70 |
However if you run your project on a Hugging Face space, you should be just fine :)
|
71 |
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
However if you run your project on a Hugging Face space, you should be just fine :)
|
71 |
|
72 |
+
### Deployment to Hugging Face
|
73 |
+
|
74 |
+
The standard free CPU instance (16 Gb) will not be enough for WizardCoder, you should use the upgraded CPU instance (32 Gb)
|
75 |
+
|
76 |
+
I haven't upgraded mine yet, so it will probably crash when you try it:
|
77 |
+
https://huggingface.co/spaces/jbilcke-hf/template-node-wizardcoder-express
|
src/index.mts
CHANGED
@@ -12,9 +12,15 @@ const app = express()
|
|
12 |
const port = 7860
|
13 |
|
14 |
app.get('/', async (req, res) => {
|
15 |
-
const
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
17 |
const raw = await llm(prompt)
|
|
|
18 |
const output = raw.split('</html>')
|
19 |
res.write(output + '</html>')
|
20 |
res.end()
|
|
|
12 |
const port = 7860
|
13 |
|
14 |
app.get('/', async (req, res) => {
|
15 |
+
const prefix = `<html><head>`
|
16 |
+
const prompt = `# Context
|
17 |
+
A website about a delicious chocolate chip cookie recipe!
|
18 |
+
# Output
|
19 |
+
${prefix}`
|
20 |
+
res.write(prefix)
|
21 |
+
console.log('calling llm')
|
22 |
const raw = await llm(prompt)
|
23 |
+
console.log('raw:', raw)
|
24 |
const output = raw.split('</html>')
|
25 |
res.write(output + '</html>')
|
26 |
res.end()
|