Merge branch 'main' into add/model-list
This commit is contained in:
commit
a5ddb9470a
@ -70,7 +70,7 @@ Jan is an open-source ChatGPT alternative that runs 100% offline on your compute
|
||||
<tr style="text-align: center">
|
||||
<td style="text-align:center"><b>Experimental (Nighlty Build)</b></td>
|
||||
<td style="text-align:center" colspan="4">
|
||||
<a href='https://github.com/janhq/jan/actions/runs/7328809734'>
|
||||
<a href='https://github.com/janhq/jan/actions/runs/7329755769'>
|
||||
<b>Github action artifactory</b>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@ -109,6 +109,8 @@ Copy the following configurations into the `model.json`.
|
||||
2. Make sure the `source_url` property is the direct binary download link ending in `.gguf`. In HuggingFace, you can find the directl links in `Files and versions` tab.
|
||||
3. Ensure you are using the correct `prompt_template`. This is usually provided in the HuggingFace model's description page.
|
||||
|
||||
> Note: Currently, the filename must be `model.json` and the ID has to be equal to the foldername. In the `model.json`, you have to include the `state` property and set it to `ready` for Jan to recognize the model.
|
||||
|
||||
```js
|
||||
{
|
||||
"source_url": "https://huggingface.co/janhq/trinity-v1-GGUF/resolve/main/trinity-v1.Q4_K_M.gguf",
|
||||
@ -130,6 +132,7 @@ Copy the following configurations into the `model.json`.
|
||||
"tags": ["7B", "Merged", "Featured"],
|
||||
"size": 4370000000
|
||||
},
|
||||
"state": "ready",
|
||||
"engine": "nitro"
|
||||
}
|
||||
```
|
||||
|
||||
@ -68,6 +68,15 @@ async function loadModel(nitroResourceProbe: any | undefined) {
|
||||
if (!nitroResourceProbe) nitroResourceProbe = await getResourcesInfo();
|
||||
return killSubprocess()
|
||||
.then(() => tcpPortUsed.waitUntilFree(PORT, 300, 5000))
|
||||
// wait for 500ms to make sure the port is free for windows platform
|
||||
.then(() => {
|
||||
if (process.platform === "win32") {
|
||||
return sleep(500);
|
||||
}
|
||||
else {
|
||||
return sleep(0);
|
||||
}
|
||||
})
|
||||
.then(() => spawnNitroProcess(nitroResourceProbe))
|
||||
.then(() => loadLLMModel(currentSettings))
|
||||
.then(validateModelStatus)
|
||||
@ -78,6 +87,11 @@ async function loadModel(nitroResourceProbe: any | undefined) {
|
||||
});
|
||||
}
|
||||
|
||||
// Add function sleep
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
function promptTemplateConverter(promptTemplate) {
|
||||
// Split the string using the markers
|
||||
const systemMarker = "{system_message}";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user