Skip to content

Commit

Permalink
Merge pull request #25 from daizeyao/master
Browse files Browse the repository at this point in the history
fix: 修复AI无法输出0
  • Loading branch information
daizeyao authored Dec 29, 2024
2 parents b11108b + 1dc80af commit 3605d14
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.8.1
v2.8.2
4 changes: 2 additions & 2 deletions web/OJ/class/Class.StreamHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function callback($ch, $data)
$this->counter += 1;
file_put_contents('./log/data.' . $this->qmd5 . '.log', $this->counter . '==' . $data . PHP_EOL . '--------------------' . PHP_EOL, FILE_APPEND);

$result = json_decode($data, TRUE);
// $result = json_decode($data, TRUE);
// echo $origin_data . PHP_EOL;
// print_r($result);

Expand Down Expand Up @@ -104,7 +104,7 @@ public function callback($ch, $data)
} else if ($this->api_type == 'chat' || $this->api_type == 'vllm-chat') {
$content = $line_data['message']['content'] ?? NULL;
}
if ($content) {
if ($content != NULL) {
$this->sensitive_check($content);
}
// echo 'content: ' . $content . PHP_EOL;
Expand Down
3 changes: 0 additions & 3 deletions web/OJ/plugins/hznuojai/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ class ChatCore {

let connectionTimeout = null;

// TODO: VLLM
// TODO: 两张显卡加载同一个大模型,并且负载均衡;如果行不通,就通过设置参数的形式跑两个不同的大模型并手动分配

// 同一个客户端只能同时建立同一个 EventSource 连接
this.eventSource.addEventListener("open", (event) => {
clearTimeout(connectionTimeout);
Expand Down
5 changes: 5 additions & 0 deletions web/OJ/plugins/hznuojai/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

// TODO: shift+enter 换行后无法复原
// TODO: 移动端兼容
// TODO: 仅AI reload功能

class FloatingChatBox {
constructor() {
this.importFile('/OJ/plugins/hznuojai/index.css', 'link');
Expand Down

0 comments on commit 3605d14

Please sign in to comment.