Bert qa app
1.0.0
该项目是一个简单的 FastAPI 应用程序,使用 Hugging Face BERT 模型进行问答。
克隆存储库:
git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
构建 Docker 镜像:
docker build -t fastapi-bert .
运行 Docker 容器:
docker run -p 7860:7860 fastapi-bert
运行 Docker 容器后,该应用程序将在http://localhost:7860
上可用。
GET / :返回“Hello World”消息。
GET /answer :接受问题和上下文作为查询参数并返回答案。
例子:
curl -X ' GET '
' http://localhost:7860/answer?question=What%20is%20the%20capital%20of%20France?&context=Paris%20is%20the%20capital%20of%20France. '
-H ' accept: application/json '