国产模型2

This commit is contained in:
zhangzhan 2024-08-11 16:22:42 +08:00
parent 79a6934e83
commit 104cb44026
2 changed files with 24 additions and 4 deletions

View File

@ -0,0 +1,20 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'MessageBean2.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
MessageBean2 _$MessageBean2FromJson(Map<String, dynamic> json) => MessageBean2(
json['sender_type'] as String?,
json['sender_name'] as String?,
json['text'] as String?,
);
Map<String, dynamic> _$MessageBean2ToJson(MessageBean2 instance) =>
<String, dynamic>{
'sender_type': instance.sender_type,
'sender_name': instance.sender_name,
'text': instance.text,
};

View File

@ -215,7 +215,7 @@ class HomeModel {
}*/
RequestCenter.instance.sendRequest2({
"model": "abab5.5s-chat",
"tokens_to_generate": 256,
"tokens_to_generate": 512,
"temperature": 0.9,
"top_p": 0.95,
"stream": false,
@ -234,7 +234,7 @@ class HomeModel {
]
}, (BaseEntity dataEntity) {
String json = dataEntity.data;
if (_extractStarredText(json).isNotEmpty) {
/*if (_extractStarredText(json).isNotEmpty) {*/
a = 0;
if (dataEntity.code == 0 && dataEntity.data != null) {
streamController.sink.add({
@ -247,7 +247,7 @@ class HomeModel {
'data': "",
});
}
} else {
/*} else {
if (a < 5) {
a++;
chat2(message);
@ -257,7 +257,7 @@ class HomeModel {
'data': "(剧情结束)",
});
}
}
}*/
}, (ErrorEntity errorEntity) {
streamController.sink.add({
'code': "0", //