bugfix
This commit is contained in:
parent
5c43989cd7
commit
d0c6a444ad
@ -300,7 +300,6 @@ body {
|
||||
}
|
||||
.tabular-header-row {
|
||||
background-color: #dddddd;
|
||||
display: table-header-group;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
width: auto;
|
||||
@ -323,6 +322,7 @@ body {
|
||||
}
|
||||
.tabular-cell {
|
||||
border: 1px solid #ccc;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
|
@ -13,14 +13,56 @@ bricks.ModelOutput = class extends bricks.HBox {
|
||||
}
|
||||
opts.width = '100%';
|
||||
super(opts);
|
||||
this.logid = null;
|
||||
this.img = new bricks.Icon({rate:2,url:this.icon||bricks_resource('imgs/llm.png')});
|
||||
this.run = new bricks.BaseRunning({target:this});
|
||||
this.add_widget(this.img);
|
||||
this.add_widget(this.run)
|
||||
this.add_widget(this.run);
|
||||
this.build_estimate_widgets();
|
||||
}
|
||||
build_estimate_widgets(){
|
||||
if (!this.estimate_url) return;
|
||||
this.estimate_w = new bricks.HBox({width:'100%', cheight:2});
|
||||
txtw = new bricks.Text({
|
||||
otext:'希望吗?‘,
|
||||
i18n:true,
|
||||
});
|
||||
likew = new bricks.Icon({rate:2, url:bricks_resource('imgs/like.png'));
|
||||
unlikew = new bricks.Icon({rate:2, url:bricks_resource('imgs/unlike.png');
|
||||
likew.bind('click', this.estimate_llm.bind(this, 1));
|
||||
unlike.bind('click', this.estimate_llm.bind(this, -1))
|
||||
this.estimate_w.add_widget(txtw);
|
||||
this.estimate_w.add_widget(likew);
|
||||
this.estimate_w.add_widget(unlikew);
|
||||
this.add_widget(this.estimate_w);
|
||||
likew.set_style('cursor', 'pointer');
|
||||
unlikew.set_style('cursor', 'pointer');
|
||||
this.estimate_w.hide();
|
||||
}
|
||||
async estimate_llm(val, event){
|
||||
var desc = {
|
||||
"widgettype":"urlwidget",
|
||||
"options":{
|
||||
"params":{
|
||||
"logid":this.logid,
|
||||
"value":val
|
||||
},
|
||||
"url":this.estimate_url
|
||||
}
|
||||
};
|
||||
var icon = event.target.bricks_widget;
|
||||
icon.rate = 2;
|
||||
icon.charsize_sizing();
|
||||
w = await bricks.widgetBuild(desc, this);
|
||||
this.estimate_w.disabled(true);
|
||||
}
|
||||
async update_data(data){
|
||||
if (this.run) this.run.stop_timepass();
|
||||
this.run = null;
|
||||
if (data.logid){
|
||||
this.logid = data.logid;
|
||||
this.estimate_w.show();
|
||||
}
|
||||
var w = await bricks.widgetBuild(this.output_view, this.llmio, data);
|
||||
w.set_css('llm_msg');
|
||||
w.set_css('filler');
|
||||
@ -68,7 +110,10 @@ bricks.LlmModel = class extends bricks.JsWidget {
|
||||
|
||||
}
|
||||
async model_inputed(data){
|
||||
var mout = new bricks.ModelOutput({icon:this.opts.icon, output_view:this.opts.output_view});
|
||||
var mout = new bricks.ModelOutput({
|
||||
icon:this.opts.icon,
|
||||
estimate_url:this.llmio.estimate_url,
|
||||
output_view:this.opts.output_view});
|
||||
this.llmio.o_w.add_widget(mout);
|
||||
var fmt = this.opts.user_message_format || { role:'user', content:'${prompt}'};
|
||||
var umsg = bricks.apply_data(fmt, data);
|
||||
|
Loading…
Reference in New Issue
Block a user