upgraded code

This commit is contained in:
Saifeddine ALOUI 2023-07-06 02:27:33 +02:00
parent 7df7e44d07
commit 1dc85118ef
7 changed files with 54 additions and 47 deletions

1
app.py
View File

@ -664,6 +664,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
def list_models(self): def list_models(self):
if self.binding is not None: if self.binding is not None:
models = self.binding.list_models(self.config) models = self.binding.list_models(self.config)
ASCIIColors.yellow("Listing models")
return jsonify(models) return jsonify(models)
else: else:
return jsonify([]) return jsonify([])

File diff suppressed because one or more lines are too long

8
web/dist/assets/index-8e2ea812.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title> <title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-60e3fd61.js"></script> <script type="module" crossorigin src="/assets/index-a6852352.js"></script>
<link rel="stylesheet" href="/assets/index-8884f14a.css"> <link rel="stylesheet" href="/assets/index-8e2ea812.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@ -290,7 +290,7 @@ export default {
}; };
}, },
async mounted() { async mounted() {
this.fileSize = await this.getFileSize(this.model.path) //this.fileSize = await this.getFileSize(this.model.path)
//console.log('model path', this.model.path) //console.log('model path', this.model.path)
nextTick(() => { nextTick(() => {
feather.replace() feather.replace()
@ -367,6 +367,10 @@ export default {
event.target.src = defaultImgPlaceholder event.target.src = defaultImgPlaceholder
}, },
toggleInstall() { toggleInstall() {
this.getFileSize(this.model.path).then(data=>{
this.fileSize = data
})
if (this.isInstalled) { if (this.isInstalled) {
this.uninstalling = true; this.uninstalling = true;
// Simulate uninstallation delay (replace this with your WebSocket logic) // Simulate uninstallation delay (replace this with your WebSocket logic)
@ -378,6 +382,9 @@ export default {
} }
}, },
toggleSelected() { toggleSelected() {
this.getFileSize(this.model.path).then(data=>{
this.fileSize = data
})
this.onSelected(this) this.onSelected(this)
}, },
toggleCopy() { toggleCopy() {

View File

@ -713,12 +713,12 @@
<!-- EXPAND / COLLAPSE BUTTON --> <!-- EXPAND / COLLAPSE BUTTON -->
<button v-if="mzl_collapsed" <button v-if="mzl_collapsed"
class="text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg " class="text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg "
title="Collapse" type="button" @click="mzl_collapsed = !mzl_collapsed"> title="Collapse" type="button" @click="open_mzl">
<i data-feather="chevron-up"></i> <i data-feather="chevron-up"></i>
</button> </button>
<button v-else <button v-else
class="text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg " class="text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg "
title="Expand" type="button" @click="mzl_collapsed = !mzl_collapsed"> title="Expand" type="button" @click="open_mzl">
<i data-feather="chevron-down"></i> <i data-feather="chevron-down"></i>
</button> </button>
</div> </div>
@ -1426,6 +1426,11 @@ export default {
}, },
async open_mzl(){
this.mzl_collapsed = !this.mzl_collapsed;
console.log("Fetching models")
//this.fetchModels();
},
async getVramUsage() { async getVramUsage() {
const resp = await this.api_get_req("vram_usage") const resp = await this.api_get_req("vram_usage")
// { // {
@ -1584,7 +1589,6 @@ export default {
}, },
fetchModels() { fetchModels() {
axios.get('/get_available_models') axios.get('/get_available_models')
.then(response => { .then(response => {
@ -2129,12 +2133,6 @@ export default {
refresh() { refresh() {
this.api_get_req("list_models").then(response => {
this.modelsArr = response
this.modelsArr.sort()
})
this.api_get_req("list_personalities_categories").then(response => { this.api_get_req("list_personalities_categories").then(response => {
this.persCatgArr = response this.persCatgArr = response
this.persCatgArr.sort() this.persCatgArr.sort()
@ -2186,7 +2184,7 @@ export default {
}) })
this.fetchModels(); //this.fetchModels();
this.api_get_req("list_bindings") this.api_get_req("list_bindings")
then(response => { then(response => {
this.bindings = response this.bindings = response