mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Allow read-only installation
Fix #3453. Thanks to #3499, #3500 and #3521, most of the obstacles to read-only installation have been resolved. This PR addresses the final piece, ensuring that SillyTavern no longer changes directories to `serverDirectory` and outputs files there. Instead, it outputs or copies necessary files to the directory where it is being run. Now, `serverDirectory` is read-only for SillyTavern (i.e., SillyTavern will not attempt to modify `serverDirectory`). Additionally, this PR sets the permissions for copied `default-user` files to be writable, so even if SillyTavern is installed as read-only, the copied `default-user` folder can still be modified.
This commit is contained in:
@ -5,14 +5,16 @@ import { Buffer } from 'node:buffer';
|
||||
|
||||
import { pipeline, env, RawImage } from 'sillytavern-transformers';
|
||||
import { getConfigValue } from './util.js';
|
||||
import { serverDirectory } from './server-directory.js';
|
||||
|
||||
configureTransformers();
|
||||
|
||||
function configureTransformers() {
|
||||
// Limit the number of threads to 1 to avoid issues on Android
|
||||
env.backends.onnx.wasm.numThreads = 1;
|
||||
console.log(env.backends.onnx.wasm.wasmPaths);
|
||||
// Use WASM from a local folder to avoid CDN connections
|
||||
env.backends.onnx.wasm.wasmPaths = path.join(process.cwd(), 'dist') + path.sep;
|
||||
env.backends.onnx.wasm.wasmPaths = path.join(serverDirectory, 'node_modules', 'sillytavern-transformers', 'dist') + path.sep;
|
||||
}
|
||||
|
||||
const tasks = {
|
||||
|
Reference in New Issue
Block a user