
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://travis-ci.com/IBM/MAX-Question-Answering-Web-App.svg?branch=master](https://travis-ci.com/github/IBM/MAX-Question-Answering-Web-App) https://img.shields.io/website/http/max-question-answering.codait-prod-41208c73af8fca213512856c7a09db52-0000.us-east.containers.appdomain.cloud/swagger.json.svg?label=api+demo]([] https://img.shields.io/website/http/max-question-answering-web-app.codait-prod-41208c73af8fca213512856c7a09db52-0000.us-east.containers.appdomain.cloud.svg]([]
Ever found yourself wondering what mitochondria are? Perhaps you are curious about how neurons communicate with each other? A Google search works well to answer your questions, but how about something still digestible, but more precise? This code pattern will show you how to build a chatbot that will answer questions found in a college biology textbook. In this pattern, the textbook used is https://books.google.com/books/about/Biology_2e.html?id=JLPQtwEACAAJ by Mary Ann Clark, Matthew Douglas, and Jung Choi.
The web app uses the https://github.com/IBM/MAX-Question-Answering to answer questions that are typed in by the user. The web application provides a chat-like interface that allows users to type in questions that are sent to a Flask python server. The backend then sends the question and related body of text from the textbook to a REST end point exposed by the MAX model which returns an answer to the question, displayed as a response from the chatbot. The model's REST endpoint is set up using the docker image provided on MAX.
When the reader has completed this Code Pattern, they will understand how to:
Ways you can run this code pattern:
You can deploy the model and web app on Kubernetes using the latest docker images on Quay.
On your Kubernetes cluster, run the following commands:
kubectl apply -f https://raw.githubusercontent.com/IBM/MAX-Question-Answering/master/max-question-answering.yaml kubectl apply -f https://raw.githubusercontent.com/IBM/MAX-Question-Answering-Web-App/master/max-question-answering-web-app.yaml
The web app will be available at port 8000 of your cluster.
The model will only be available internally, but can be accessed externally through the NodePort.
Start the Model API
Build the Web App
Deploy the Model
To run the docker image, which automatically starts the model serving API, run:
$ docker run -it -p 5000:5000 quay.io/codait/max-question-answering
This will pull a pre-built image from Quay (or use an existing image if already cached locally) and run it. If you'd rather build and run the model locally, or deploy on a Kubernetes cluster, you can follow the steps in the https://github.ibm.com/CODAIT/MAX-Question-Answering#steps
Experiment with Model API (optional)
The API server automatically generates an interactive Swagger documentation page.
Go to http://localhost:5000 to load it. From there you can explore the API and also create test requests.
Use the model/predict endpoint to enter in text data and get answers from the model.
The https://github.ibm.com/CODAIT/MAX-Question-Answering/tree/master/samples contains samples you can use to test out the API, or you can use your own.
You can also test it on the command line, for example:
bash$ curl -X POST "http://localhost:5000/model/predict" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"paragraphs\": [{ \"context\": \"John lives in Brussels and works for the EU\", \"questions\": [\"Where does John Live?\",\"What does John do?\",\"What is his name?\" ]},{ \"context\": \"Jane lives in Paris and works for the UN\", \"questions\": [\"Where does Jane Live?\",\"What does Jane do?\" ]}]}"
Clone the repository
Clone the web app repository locally. In a terminal, run the following command:
$ git clone https://github.com/IBM/MAX-Question-Answering-Web-App.git
Change directory into the repository base folder:
$ cd MAX-Question-Answering-Web-App
Install dependencies
Before running this web app you must install its dependencies:
$ pip install -r requirements.txt
Start the server
You then start the web app by running:
$ python app.py
You can then access the web app at: http://localhost:8000
Configure ports (Optional)
If you want to use a different port or are running the model API at a different location you can change them with command-line options:
$ python app.py --port=8000 --ml-endpoint=http://localhost:5000
Instructions for Docker (Optional)
To run the web app with Docker the containers running the web server and the REST endpoint need to share the same network stack. This is done in the following steps:
Modify the command that runs the MAX Question Answering REST endpoint to map an additional port in the container to a
port on the host machine. In the example below it is mapped to port 8000 on the host but other ports can also be used.
docker run -it -p 5000:5000 -p 8000:8000 --name max-question-answering quay.io/codait/max-question-answering
Build the web app image by running:
docker build -t max-question-answering-web-app .
Run the web app container using:
docker run --net='container:max-question-answering' -it max-question-answering-web-app
Web app license https://creativecommons.org/licenses/by/4.0/
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务