# softwarecup **Repository Path**: shine2010/softwarecup ## Basic Information - **Project Name**: softwarecup - **Description**: softwarecup代码 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-12 - **Last Updated**: 2026-05-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 准备 ## python3.11 ## 安装 git 打开 https://git-scm.com/install/windows,下载安装 ## 注册 https://gitee.com/ 邮箱发我 创建令牌 命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议配置并使用私人令牌替代登录密码进行克隆、推送等操作: ``` Username for 'https://gitee.com': shine2010 Password for 'https://shine2010@gitee.com': 你的令牌 ``` # 下载代码 ## 命令行 ```powershell git clone https://gitee.com/shine2010/softwarecup.git ``` ## pip 安装 进入项目目录: ```powershell pip install -r .\requirements.txt ``` # 安装 Ollama https://ollama.com/download 安装完成后拉取所需模型: ```powershell ollama pull qwen2.5-coder:3b ollama pull nomic-embed-text ``` ## 构建知识库索引 将课件、文档等放到 `knowlege` 目录,然后运行: ```powershell python utils\index_builder.py ``` # 运行方式 ## 方式一:Streamlit 版(原版) ```powershell streamlit run app.py ``` ## 方式二:HTML 静态页面版(pages_html) HTML 版无需 Streamlit,但 AI 智能助学页面需要先启动 FastAPI 后端。 ### 第一步:启动 API 后端 ```powershell uvicorn api_server:app --host 0.0.0.0 --port 8502 --reload ``` 启动成功后终端显示: ``` INFO: Uvicorn running on http://0.0.0.0:8502 (Press CTRL+C to quit) ``` 访问 http://localhost:8502/docs 可查看并测试所有接口。 > 前提:`ollama serve` 已运行,且知识库索引已构建。 ### 第二步:打开浏览器 后端启动后,`pages_html` 目录已作为静态资源挂载到 `/pages` 路径,直接用浏览器访问即可: | 页面 | 访问地址 | |------|----------| | 默认入口 | http://localhost:8502/ (自动跳转至课程首页) | | 课程首页 | http://localhost:8502/pages/index.html | | 0 情景导入 | http://localhost:8502/pages/0_intro.html | | 8 AI 智能助学 | http://localhost:8502/pages/ai.html | > **注意**:`ai.html` 需要后端已启动,否则发送问题时提示连接失败。