moving default model settings to .env

This commit is contained in:
Raven Scott 2023-04-07 21:42:17 +02:00
parent 3326ffbb6c
commit e3c5341561
3 changed files with 23 additions and 21 deletions

View File

@ -30,16 +30,9 @@ Message intents are NOT supported in this bot, this is due to the verification t
1) Use ```npm i ``` 1) Use ```npm i ```
2) Create a .env file ``` touch .env``` 2) Create a .env file ``` cp default.env .env```
3) Edit .env 3) Edit .env ```nano .env```
```
TOKEN = (Discord Token)
INTERNAL_IP = (The Internal IP Address of the Server running Serge)
PUBLIC_URL = (The public URL of your Serge install)
SERGE_PORT = (The PORT of your Serge install) - DEFAULT: 8008
```
4) Go into https://discord.com/developers/applications and enable Privileged Intents 4) Go into https://discord.com/developers/applications and enable Privileged Intents

View File

@ -5,24 +5,23 @@ const jsonfile = require('jsonfile')
// Start session defaults: // Start session defaults:
var apiUrl = `http://${process.env.INTERNAL_IP}:${process.env.SERGE_PORT}/api/chat/`; var apiUrl = `http://${process.env.INTERNAL_IP}:${process.env.SERGE_PORT}/api/chat/`;
var model = 'gpt4all'; var model = process.env.MODEL;
var temperature = 0.1; var temperature = process.env.TEMPERATURE;
var topK = 50; var topK = process.env.TOPK;
var topP = 0.95; var topP = process.env.TOPP;
var maxLength = 256; var maxLength = process.env.MAXLENGTH;
var contextWindow = 512; var contextWindow = process.env.CONTEXTWINDOW;
var repeatLastN = 64; var repeatLastN = process.env.REPEATLASTN;
var repeatPenalty = 1.3; var repeatPenalty = process.env.REPEATPENALTY;
var nThreads = 7; var nThreads = process.env.NTHREADS;
// End session defaults // End session defaults
// Set model list we have downloaded // Set model list we have downloaded
let modelList = ["7B", "7B-native", "gpt4all"] let modelList = ["7B", "7B-native", "gpt4all"]
module.exports = { module.exports = {
name: "create-session", name: "create-session",
description: "create a new chat session", description: "create a new session",
private: true, private: true,
options: [{ options: [{
"name": "model", "name": "model",

View File

@ -2,3 +2,13 @@ TOKEN = ""
INTERNAL_IP = "" INTERNAL_IP = ""
PUBLIC_URL = "" PUBLIC_URL = ""
SERGE_PORT = "8008" SERGE_PORT = "8008"
MODEL = "7B"
TEMPERATURE = "0.1"
TOPK = "50"
TOPP = "0.95"
MAXLENGTH = "256"
CONTEXTWINDOW = "512"
REPEATLASTN = "64"
REPEATPENALTY = "1.3"
NTHREADS = "7"