This commit is contained in:
Wenjie Zhang 2025-06-17 10:54:45 +08:00
parent cc0e14e677
commit 8ac7b0a847
4 changed files with 55 additions and 8 deletions

View File

@ -166,6 +166,39 @@ services:
restart: unless-stopped
command: python -m uvicorn app:app --host 0.0.0.0 --port 5051 --app-dir /app
# # lastest version: wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
# mineru-sglang:
# build:
# context: scripts/mineru-sglang
# dockerfile: Dockerfile
# image: mineru-sglang:latest
# container_name: mineru-sglang
# ports:
# - 30000:30000
# environment:
# MINERU_MODEL_SOURCE: modelscope
# entrypoint: mineru-sglang-server
# command:
# --host 0.0.0.0
# --port 30000
# ulimits:
# memlock: -1
# stack: 67108864
# ipc: host
# healthcheck:
# test: ["CMD-SHELL", "curl -f http://localhost:30000/health || exit 1"]
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# device_ids: ["0"]
# capabilities: [gpu]
# networks:
# - app-network
# restart: unless-stopped
networks:
app-network:
driver: bridge

View File

@ -0,0 +1,13 @@
# Lastest version: wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/Dockerfile
# Use the official sglang image
FROM lmsysorg/sglang:v0.4.7-cu124
# install mineru latest
RUN python3 -m pip install -U 'mineru[core]' -i https://mirrors.aliyun.com/pypi/simple --break-system-packages
# Download models and update the configuration file
RUN /bin/bash -c "mineru-models-download -s modelscope -m all"
# Set the entry point to activate the virtual environment and run the command line tool
ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]

View File

@ -162,7 +162,7 @@ const toggleCollapse = () => {
.chat-sidebar {
width: 0;
height: 100%;
background-color: #f9f9f9;
background-color: var(--bg-sider);
transition: all 0.3s ease;
display: flex;
flex-direction: column;

View File

@ -11,12 +11,12 @@
</HeaderComponent>
<div class="setting-container layout-container">
<div class="sider" v-if="state.windowWidth > 520">
<a-button type="text" :class="{ activesec: state.section === 'base'}" @click="state.section='base'" :icon="h(SettingOutlined)"> 基本设置 </a-button>
<a-button type="text" :class="{ activesec: state.section === 'model'}" @click="state.section='model'" :icon="h(CodeOutlined)"> 模型配置 </a-button>
<a-button type="text" :class="{ activesec: state.section === 'path'}" @click="state.section='path'" :icon="h(FolderOutlined)"> 路径配置 </a-button>
<a-button type="text" v-if="userStore.isSuperAdmin" :class="{ activesec: state.section === 'base'}" @click="state.section='base'" :icon="h(SettingOutlined)"> 基本设置 </a-button>
<a-button type="text" v-if="userStore.isSuperAdmin" :class="{ activesec: state.section === 'model'}" @click="state.section='model'" :icon="h(CodeOutlined)"> 模型配置 </a-button>
<a-button type="text" v-if="userStore.isSuperAdmin" :class="{ activesec: state.section === 'path'}" @click="state.section='path'" :icon="h(FolderOutlined)"> 路径配置 </a-button>
<a-button type="text" :class="{ activesec: state.section === 'user'}" @click="state.section='user'" :icon="h(UserOutlined)" v-if="userStore.isAdmin"> 用户管理 </a-button>
</div>
<div class="setting" v-if="state.windowWidth <= 520 || state.section === 'base'">
<div class="setting" v-if="(state.windowWidth <= 520 || state.section === 'base') && userStore.isSuperAdmin">
<h3>检索配置</h3>
<div class="section">
<div class="card card-select">
@ -90,12 +90,12 @@
</div>
</div>
</div>
<div class="setting" v-if="state.windowWidth <= 520 || state.section === 'model'">
<div class="setting" v-if="(state.windowWidth <= 520 || state.section === 'model') && userStore.isSuperAdmin">
<h3>模型配置</h3>
<p>请在 <code>src/.env</code> 文件中配置对应的 APIKEY并重新启动服务</p>
<ModelProvidersComponent />
</div>
<div class="setting" v-if="state.windowWidth <= 520 || state.section ==='path'">
<div class="setting" v-if="(state.windowWidth <= 520 || state.section ==='path') && userStore.isSuperAdmin">
<h3>本地模型配置</h3>
<p>如果是 Docker 启动务必确保在 docker-compose.dev.yaml 中添加了 volumes 映射</p>
<TableConfigComponent
@ -104,7 +104,7 @@
/>
</div>
<!-- TODO 用户管理优化添加姓名默认使用用户名配置项 -->
<div class="setting" v-if="state.section === 'user'">
<div class="setting" v-if="state.section === 'user' && userStore.isAdmin">
<UserManagementComponent />
</div>
</div>
@ -204,6 +204,7 @@ const handleChatModelSelect = ({ provider, name }) => {
onMounted(() => {
updateWindowWidth()
window.addEventListener('resize', updateWindowWidth)
state.section = userStore.isSuperAdmin ? 'base' : 'user'
})
onUnmounted(() => {