mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-06-07 06:06:20 -04:00
Compare commits
4 commits
93b3752cdf
...
3829507d0f
Author | SHA1 | Date | |
---|---|---|---|
|
3829507d0f | ||
|
3d676cd50f | ||
|
66a75c899a | ||
|
9bd7359ffa |
3 changed files with 16 additions and 1 deletions
|
@ -95,6 +95,12 @@ function startEditing(messageElement, messageBody, isUserMessage) {
|
||||||
editingInterface.textarea.focus();
|
editingInterface.textarea.focus();
|
||||||
editingInterface.textarea.setSelectionRange(rawText.length, rawText.length);
|
editingInterface.textarea.setSelectionRange(rawText.length, rawText.length);
|
||||||
|
|
||||||
|
// Scroll the textarea into view
|
||||||
|
editingInterface.textarea.scrollIntoView({
|
||||||
|
behavior: "smooth",
|
||||||
|
block: "center"
|
||||||
|
});
|
||||||
|
|
||||||
// Setup event handlers
|
// Setup event handlers
|
||||||
setupEditingHandlers(editingInterface.textarea, messageElement, originalHTML, messageBody, isUserMessage);
|
setupEditingHandlers(editingInterface.textarea, messageElement, originalHTML, messageBody, isUserMessage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,7 @@ function isElementVisibleOnScreen(element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSyntaxHighlighting() {
|
function doSyntaxHighlighting() {
|
||||||
const messageBodies = document.querySelectorAll(".message-body");
|
const messageBodies = document.getElementById("chat").querySelectorAll(".message-body");
|
||||||
|
|
||||||
if (messageBodies.length > 0) {
|
if (messageBodies.length > 0) {
|
||||||
observer.disconnect();
|
observer.disconnect();
|
||||||
|
@ -229,6 +229,7 @@ function doSyntaxHighlighting() {
|
||||||
codeBlocks.forEach((codeBlock) => {
|
codeBlocks.forEach((codeBlock) => {
|
||||||
hljs.highlightElement(codeBlock);
|
hljs.highlightElement(codeBlock);
|
||||||
codeBlock.setAttribute("data-highlighted", "true");
|
codeBlock.setAttribute("data-highlighted", "true");
|
||||||
|
codeBlock.classList.add("pretty_scrollbar");
|
||||||
});
|
});
|
||||||
|
|
||||||
renderMathInElement(messageBody, {
|
renderMathInElement(messageBody, {
|
||||||
|
|
|
@ -60,6 +60,14 @@ from modules.utils import gradio
|
||||||
|
|
||||||
def signal_handler(sig, frame):
|
def signal_handler(sig, frame):
|
||||||
logger.info("Received Ctrl+C. Shutting down Text generation web UI gracefully.")
|
logger.info("Received Ctrl+C. Shutting down Text generation web UI gracefully.")
|
||||||
|
|
||||||
|
# Explicitly stop LlamaServer to avoid __del__ cleanup issues during shutdown
|
||||||
|
if shared.model and shared.model.__class__.__name__ == 'LlamaServer':
|
||||||
|
try:
|
||||||
|
shared.model.stop()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue