Thu Jul 13 20:01:00 CST 2023 inscode

上级 c5ccd790
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<div class="flex-auto bg-slate-300 md:bg-slate-300 p-2 sm:p-8"> <div class="flex-auto bg-slate-300 md:bg-slate-300 p-2 sm:p-8">
<div class="w-full bg-slate-200 h-full m-auto relative container max-w-6xl rounded-xl"> <div class="w-full bg-slate-200 h-full m-auto relative container max-w-6xl rounded-xl">
<div class="w-full h-full pb-24 p-4 overflow-y-auto overflow-x-hidden" ref="messageList"> <div class="w-full h-full pb-24 p-4 overflow-y-auto overflow-x-hidden" ref="messageList">
<div v-for="item in message" class="mb-8"> <div v-for="(item,index) in message" class="mb-8">
<div v-if="item.user === 'User'"> <div v-if="item.user === 'User'">
<div class="flex flex-row-reverse"> <div class="flex flex-row-reverse">
<t-image class="rounded-lg" v-if="config.user_img" :src="config.user_img" fit="cover" <t-image class="rounded-lg" v-if="config.user_img" :src="config.user_img" fit="cover"
...@@ -88,10 +88,13 @@ ...@@ -88,10 +88,13 @@
<img v-if="item.img" :src="item.img"/> <img v-if="item.img" :src="item.img"/>
<img v-else src="/loading.gif" class="w-[512px]"/> <img v-else src="/loading.gif" class="w-[512px]"/>
</template> </template>
<template v-else> <template v-else-if="item.message && item.message.length > 5">{{ item.message }}
{{ item.message ? item.message : '...' }} <markdown-it-vue class="md-body" content="123" :options="mdOptions" :key="index" v-if="item.message"/>
</template> </template>
<template v-else>
获取中...
</template>
</div> </div>
</div> </div>
</div> </div>
...@@ -111,7 +114,7 @@ ...@@ -111,7 +114,7 @@
<div class="w-full h-10 flex"> <div class="w-full h-10 flex">
<input v-model="prompt" class="flex-auto ring-0 outline-0 pl-2 bg-slate-200 h-10" v-on:keyup.enter="query" placeholder="提示词" /> <input v-model="prompt" class="flex-auto ring-0 outline-0 pl-2 bg-slate-200 h-10" v-on:keyup.enter="query" placeholder="提示词" />
<t-dropdown :options="options" @click="clickHandler" class="ml-4 mt-1"> <t-dropdown :options="options" @click="clickHandler" class="ml-4 mt-1" v-if="mode === 'draw'">
<t-button theme="default" variant="text" shape="square"> <t-button theme="default" variant="text" shape="square">
<t-icon :name="modeImage" size="24" class="w-6 h-6 text-cyan-800 font-bold hover:text-cyan-600 cursor-pointer"/> <t-icon :name="modeImage" size="24" class="w-6 h-6 text-cyan-800 font-bold hover:text-cyan-600 cursor-pointer"/>
</t-button> </t-button>
...@@ -158,17 +161,21 @@ import SDApi from './js/sd.js' ...@@ -158,17 +161,21 @@ import SDApi from './js/sd.js'
import StorageApi from './js/storage.js' import StorageApi from './js/storage.js'
import PodsApi from './js/pod.js' import PodsApi from './js/pod.js'
import RepEs from './js/repEs.js' import RepEs from './js/repEs.js'
import { MessagePlugin } from 'tdesign-vue-next';
// import MarkdownItVue from 'markdown-it-vue' // import MarkdownItVue from 'markdown-it-vue'
// import 'markdown-it-vue/dist/markdown-it-vue.css' // import 'markdown-it-vue/dist/markdown-it-vue.css'
// https://github.com/ravenq/markdown-it-vue // https://github.com/ravenq/markdown-it-vue
import MarkdownItVue from 'markdown-it-vue'
import 'markdown-it-vue/dist/markdown-it-vue.css'
// const DataServe = new Data() // const DataServe = new Data()
export default { export default {
name: 'LlmApp', name: 'LlmApp',
components: { components: {
// MarkdownItVue MarkdownItVue
}, },
data() { data() {
return { return {
...@@ -210,13 +217,24 @@ export default { ...@@ -210,13 +217,24 @@ export default {
height: 512, height: 512,
steps: 20, steps: 20,
sampler: 'DPM++ SDE Karras', sampler: 'DPM++ SDE Karras',
showMoreSetting: true, showMoreSetting: false,
default_prompt: '1girl, (ulzzang-6500:0.7), kpop idol, yae miko, detached sleeves, bare shoulders, pink hair, long hair, cleavage,japanese clothes,breast,best quality, (painting:1.5), (hair ornament:1.35), jewelry, purple eyes, earrings, breasts, torii, cherry blossoms, lantern light, depth of field, detailed face, face focus, ribbon_trim, (looking at viewer:1.25), nontraditional miko, shiny skin, long sleeves, smile, thick lips, game cg, east asian architecture, (blurry background:1.2), sitting, upper body <lora:YaeMiko_Test:0.45>,<lora:mix4:0.5>', default_prompt: '1girl, (ulzzang-6500:0.7), kpop idol, yae miko, detached sleeves, bare shoulders, pink hair, long hair, cleavage,japanese clothes,breast,best quality, (painting:1.5), (hair ornament:1.35), jewelry, purple eyes, earrings, breasts, torii, cherry blossoms, lantern light, depth of field, detailed face, face focus, ribbon_trim, (looking at viewer:1.25), nontraditional miko, shiny skin, long sleeves, smile, thick lips, game cg, east asian architecture, (blurry background:1.2), sitting, upper body <lora:YaeMiko_Test:0.45>,<lora:mix4:0.5>',
negative_prompt: 'nfsw, bright lantern, brightness, (nipples:1.2), pussy, EasyNegative, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers, fewer fingers, strange fingers, bad hand, bare thighs,hand,bad finger', negative_prompt: 'nfsw, bright lantern, brightness, (nipples:1.2), pussy, EasyNegative, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers, fewer fingers, strange fingers, bad hand, bare thighs,hand,bad finger',
history: { history: {
name: 'ai', name: 'ai',
key: 'history', key: 'history',
}, },
mdOptions: {
markdownIt: {
linkify: true
},
linkAttributes: {
attrs: {
target: '_blank',
rel: 'noopener'
}
}
}
} }
}, },
methods: { methods: {
......
...@@ -26,7 +26,7 @@ class OpenAI { ...@@ -26,7 +26,7 @@ class OpenAI {
const stop = config?.stop??'[DONE]' const stop = config?.stop??'[DONE]'
const max_tokens = config?.api_max_token??512 const max_tokens = config?.api_max_token??512
const model = config?.model??'vicuna-13b-all-v1.1' const model = config?.model??'vicuna-13b-all-v1.1'
const temperature = this.temperature const temperature = this.temperature??0.1
const top_p = config?.top_p??1.0 const top_p = config?.top_p??1.0
let stop_key = config?.stop_key??null let stop_key = config?.stop_key??null
if (stop_key !== null && stop_key !== '') { if (stop_key !== null && stop_key !== '') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册