mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-03-02 20:08:40 +00:00
upgraded tool
This commit is contained in:
parent
9fd814a3b3
commit
18eb207fa8
5
app.py
5
app.py
@ -386,8 +386,9 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
def new_discussion(self):
|
def new_discussion(self):
|
||||||
title = request.args.get("title")
|
title = request.args.get("title")
|
||||||
timestamp = self.create_new_discussion(title)
|
timestamp = self.create_new_discussion(title)
|
||||||
app.config['executor'] = ThreadPoolExecutor(max_workers=1)
|
# app.config['executor'] = ThreadPoolExecutor(max_workers=1)
|
||||||
app.config['executor'].submit(self.create_chatbot)
|
# app.config['executor'].submit(self.create_chatbot)
|
||||||
|
# target=self.create_chatbot()
|
||||||
|
|
||||||
# Return a success response
|
# Return a success response
|
||||||
return json.dumps({"id": self.current_discussion.discussion_id, "time": timestamp, "welcome_message":self.personality["welcome_message"], "sender":self.personality["name"]})
|
return json.dumps({"id": self.current_discussion.discussion_id, "time": timestamp, "welcome_message":self.personality["welcome_message"], "sender":self.personality["name"]})
|
||||||
|
@ -17,7 +17,7 @@ __copyright__ = "Copyright 2023, "
|
|||||||
__license__ = "Apache 2.0"
|
__license__ = "Apache 2.0"
|
||||||
|
|
||||||
def load_config(file_path):
|
def load_config(file_path):
|
||||||
with open(file_path, 'r') as stream:
|
with open(file_path, 'r', encoding='utf-8') as stream:
|
||||||
config = yaml.safe_load(stream)
|
config = yaml.safe_load(stream)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
@ -93,7 +93,8 @@ function addMessage(sender, message, id, rank = 0, can_edit = false) {
|
|||||||
let hiddenElement_ = undefined
|
let hiddenElement_ = undefined
|
||||||
|
|
||||||
elements = addMessage("", "", 0, 0, can_edit = true);
|
elements = addMessage("", "", 0, 0, can_edit = true);
|
||||||
|
// scroll to bottom of chat window
|
||||||
|
chatWindow.scrollTop = chatWindow.scrollHeight;
|
||||||
fetch("/run_to", {
|
fetch("/run_to", {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
function load_discussion(discussion=0){
|
function load_discussion(discussion=0){
|
||||||
var container = document.getElementById('chat-window');
|
var chatWindow = document.getElementById('chat-window');
|
||||||
|
|
||||||
if(discussion)
|
if(discussion)
|
||||||
{
|
{
|
||||||
@ -24,12 +24,14 @@ function load_discussion(discussion=0){
|
|||||||
const messages = JSON.parse(data);
|
const messages = JSON.parse(data);
|
||||||
console.log(messages)
|
console.log(messages)
|
||||||
// process messages
|
// process messages
|
||||||
container.innerHTML = '';
|
chatWindow.innerHTML = '';
|
||||||
messages.forEach(message => {
|
messages.forEach(message => {
|
||||||
console.log(`Adding message ${message.type}`)
|
console.log(`Adding message ${message.type}`)
|
||||||
if(message.type==0){
|
if(message.type==0){
|
||||||
console.log("Showing message")
|
console.log("Showing message")
|
||||||
addMessage(message.sender, message.content, message.id, message.rank, true);
|
addMessage(message.sender, message.content, message.id, message.rank, true);
|
||||||
|
// scroll to bottom of chat window
|
||||||
|
chatWindow.scrollTop = chatWindow.scrollHeight;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -35,6 +35,8 @@ function update_main(){
|
|||||||
|
|
||||||
user_msg = addMessage('',message, 0, 0, can_edit=true);
|
user_msg = addMessage('',message, 0, 0, can_edit=true);
|
||||||
bot_msg = addMessage('', '', 0, 0, can_edit=true);
|
bot_msg = addMessage('', '', 0, 0, can_edit=true);
|
||||||
|
// scroll to bottom of chat window
|
||||||
|
chatWindow.scrollTop = chatWindow.scrollHeight;
|
||||||
|
|
||||||
fetch('/generate', {
|
fetch('/generate', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -231,6 +231,7 @@ fetch('/settings')
|
|||||||
}
|
}
|
||||||
|
|
||||||
function populate_models(){
|
function populate_models(){
|
||||||
|
selectModel.innerHTML=""
|
||||||
// Fetch the list of .bin files from the models subfolder
|
// Fetch the list of .bin files from the models subfolder
|
||||||
fetch('/list_models')
|
fetch('/list_models')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user