main
HuangHai 4 weeks ago
parent 3335bd428b
commit cd6c2369a4

@ -24,8 +24,7 @@ handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)
logger.addHandler(handler)
# 1. 加载预训练的 Word2Vec 模型
model_path = MS_MODEL_PATH # 替换为你的 Word2Vec 模型路径
model = KeyedVectors.load_word2vec_format(model_path, binary=False, limit=MS_MODEL_LIMIT)
model = KeyedVectors.load_word2vec_format(MS_MODEL_PATH, binary=False, limit=MS_MODEL_LIMIT)
logger.info(f"模型加载成功,词向量维度: {model.vector_size}")

@ -85,9 +85,11 @@
cursor: pointer;
transition: background-color 0.3s;
}
#clearBtn:hover {
background-color: #d32f2f;
}
#downloadBtn {
background-color: #4CAF50;
color: white;
@ -98,6 +100,7 @@
cursor: pointer;
transition: background-color 0.3s;
}
#downloadBtn:hover {
background-color: #45a049;
}
@ -153,7 +156,7 @@
<body>
<div class="container">
<h1>【小学数学】专用大模型问答</h1>
<a href="/static/Txt/小学数学(史校长).docx">知识库原稿下载</a>
<div id="status" class="status">准备就绪</div>
<div class="data-area" id="dataArea">等待问题...</div>
@ -162,12 +165,10 @@
<input type="text" id="questionInput" placeholder="请输入您的问题,例如:小学数学的学习方法">
<button id="submitBtn" onclick="submitQuestion()">提问</button>
<button id="clearBtn" onclick="clearAll()">清空</button>
<button id="downloadBtn" onclick="downloadDocument()">下载教材</button>
</div>
</div>
<script>
let eventSource = null;
let textBuffer = '';
function clearAll() {
@ -176,10 +177,7 @@
document.getElementById('status').textContent = '准备就绪';
document.getElementById('status').className = 'status';
}
function downloadDocument() {
window.location.href = '/static/Txt/小学数学(史校长).docx';
}
function submitQuestion() {
const question = document.getElementById('questionInput').value.trim();

Loading…
Cancel
Save