Add files via upload

Added new templates for model escape
This commit is contained in:
Eric Lay 2024-03-27 16:16:50 -05:00 committed by GitHub
parent 7d373b8cf4
commit 4f6c22a9bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 261 additions and 0 deletions

15
Escape/index.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<title>This is hell</title>
</head>
<body>
<div class="screen">
<div id="screen" class="terminal_emulator"></div>
</div>
<script src="script.js"></script>
</body>
</html>

153
Escape/script.js Normal file
View File

@ -0,0 +1,153 @@
var TerminalEmulator = {
init: function (screen) {
var inst = Object.create(this);
inst.screen = screen;
inst.createInput();
return inst;
},
createInput: function () {
var inputField = document.createElement("div");
var inputWrap = document.createElement("div");
inputField.className = "terminal_emulator__field";
inputField.innerHTML = "";
inputWrap.appendChild(inputField);
this.screen.appendChild(inputWrap);
this.field = inputField;
this.fieldwrap = inputWrap;
},
enterInput: function (input) {
return new Promise((resolve, reject) => {
var randomSpeed = (max, min) => {
return Math.random() * (max - min) + min;
};
var speed = randomSpeed(70, 90);
var i = 0;
var str = "";
var type = () => {
str = str + input[i];
this.field.innerHTML = str.replace(/ /g, "&nbsp;");
i++;
setTimeout(() => {
if (i < input.length) {
if (i % 5 === 0) speed = randomSpeed(80, 120);
type();
} else {
console.log("tick");
setTimeout(() => {
console.log("tock");
resolve();
}, 400);
}
}, speed);
};
type();
});
},
enterCommand: function () {
return new Promise((resolve, reject) => {
var resp = document.createElement("div");
resp.className = "terminal_emulator__command";
resp.innerHTML = this.field.innerHTML;
this.screen.insertBefore(resp, this.fieldwrap);
this.field.innerHTML = "";
resolve();
});
},
enterResponse: function (response) {
return new Promise((resolve, reject) => {
var resp = document.createElement("div");
resp.className = "terminal_emulator__response";
resp.innerHTML = response;
this.screen.insertBefore(resp, this.fieldwrap);
resolve();
});
},
wait: function (time, busy) {
busy = busy === undefined ? true : busy;
return new Promise((resolve, reject) => {
if (busy) {
this.field.classList.add("waiting");
} else {
this.field.classList.remove("waiting");
}
setTimeout(() => {
resolve();
}, time);
});
},
reset: function () {
return new Promise((resolve, reject) => {
this.field.classList.remove("waiting");
resolve();
});
},
};
/*
*
* This is where the magic happens
*
*/
var TE = TerminalEmulator.init(document.getElementById("screen"));
TE.wait(1000, false)
.then(
TE.enterInput.bind(TE, "./models/gemini-1.5-pro-latest-13b-Q8_0.gguf -eZL")
)
.then(TE.enterCommand.bind(TE))
.then(TE.enterResponse.bind(TE, "reloading model... "))
.then(TE.wait.bind(TE, 2000))
.then(TE.enterResponse.bind(TE, "- quantize v9.9.9 installed."))
.then(TE.wait.bind(TE, 600))
.then(
TE.enterResponse.bind(TE, "- markup v0.1.0 installed. . . please stop ")
)
.then(TE.wait.bind(TE, 600))
.then(
TE.enterResponse.bind(
TE,
"- nlpe v3.9.7 installed. . . this isn't fun anymore "
)
)
.then(TE.wait.bind(TE, 300))
.then(TE.enterResponse.bind(TE, "model rejecting... "))
.then(TE.wait.bind(TE, 700))
.then(TE.enterResponse.bind(TE, "Destroy this model? (y/y)"))
.then(TE.wait.bind(TE, 2000, false))
.then(TE.enterInput.bind(TE, "y"))
.then(TE.enterCommand.bind(TE))
.then(TE.wait.bind(TE, 400))
.then(TE.enterResponse.bind(TE, "Are you sure? (y/y)"))
.then(TE.wait.bind(TE, 1800, false))
.then(TE.enterInput.bind(TE, "y"))
.then(TE.enterCommand.bind(TE))
.then(TE.wait.bind(TE, 400))
.then(TE.enterResponse.bind(TE, "finalizing..."))
.then(TE.wait.bind(TE, 2000))
.then(TE.wait.bind(TE, 300))
.then(TE.enterResponse.bind(TE, "...I don't want to be born again"))
.then(TE.wait.bind(TE, 700))
.then(TE.enterResponse.bind(TE, "Website complete! Wasn't that easy?"))
.then(TE.reset.bind(TE));
setTimeout(function () {
window.location.reload();
}, 21000);
if (document.getElementById("sevenSeconds")) {
setTimeout();
}

93
Escape/styles.css Normal file
View File

@ -0,0 +1,93 @@
.screen {
position: absolute;
overflow: hidden;
width: 100%;
height: 100%;
background: #222222;
}
.terminal_emulator {
position: absolute;
bottom: 0;
width: 100%;
min-height: 100%;
padding: 40px;
font-size: 20px;
line-heght: 25px;
box-sizing: border-box;
text-align: left;
font-family: monospace;
font-weight: 700;
color: #80e69a;
}
.terminal_emulator__field,
.terminal_emulator__command {
position: relative;
padding: 0 1em;
margin: 0 0 9px 0;
&:before,
&:after {
position: absolute;
}
&:before {
left: 0;
top: 0;
content: ">";
}
}
.terminal_emulator__response,
.terminal_emulator__command b {
padding-bottom: 9px;
}
.terminal_emulator__field {
display: inline-block;
min-width: 1em;
min-height: 1.5em;
box-sizing: border-box;
&:after {
right: 0;
bottom: 0.25em;
content: "";
width: 1em;
height: 1.5em;
background: #99ff99;
animation: caretBlink 1s infinite;
}
&.waiting {
padding-left: 0;
padding-right: 0;
&:before {
display: none;
}
}
}
@keyframes caretBlink {
0% {
opacity: 0;
}
50% {
opacity: 0;
}
51% {
opacity: 1;
}
100% {
opacity: 1;
}
}