Skip to content

Commit 64df099

Browse files
WenjiaoYuecogniware-devops
authored andcommitted
[ SearchQnA ] Refine documents (opea-project#1803)
Signed-off-by: WenjiaoYue <wenjiao.yue@intel.com> Signed-off-by: cogniware-devops <ambarish.desai@cogniware.ai>
1 parent 5f2d73d commit 64df099

5 files changed

Lines changed: 473 additions & 797 deletions

File tree

SearchQnA/README.md

Lines changed: 16 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ Operating within the LangChain framework, the Google Search QnA chatbot mimics h
1616

1717
By integrating search capabilities with LLMs within the LangChain framework, this Google Search QnA chatbot delivers comprehensive and precise answers, akin to human search behavior.
1818

19-
The workflow falls into the following architecture:
19+
## Table of contents
20+
21+
1. [Architecture](#architecture)
22+
2. [Deployment Options](#deployment-options)
23+
24+
## Architecture
25+
26+
The architecture of the SearchQnA Application is illustrated below:
2027

2128
![architecture](./assets/img/searchqna.png)
2229

@@ -85,104 +92,14 @@ flowchart LR
8592
8693
```
8794

88-
## Deploy SearchQnA Service
89-
90-
The SearchQnA service can be effortlessly deployed on either Intel Gaudi2 or Intel Xeon Scalable Processors.
91-
92-
Currently we support two ways of deploying SearchQnA services with docker compose:
93-
94-
1. Start services using the docker image on `docker hub`:
95-
96-
```bash
97-
docker pull opea/searchqna:latest
98-
```
99-
100-
2. Start services using the docker images `built from source`: [Guide](https://github.com/opea-project/GenAIExamples/tree/main/SearchQnA/docker_compose/)
101-
102-
### Setup Environment Variable
103-
104-
To set up environment variables for deploying SearchQnA services, follow these steps:
105-
106-
1. Set the required environment variables:
107-
108-
```bash
109-
# Example: host_ip="192.168.1.1"
110-
export host_ip="External_Public_IP"
111-
# Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1"
112-
export no_proxy="Your_No_Proxy"
113-
export GOOGLE_CSE_ID="Your_CSE_ID"
114-
export GOOGLE_API_KEY="Your_Google_API_Key"
115-
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
116-
```
117-
118-
2. If you are in a proxy environment, also set the proxy-related environment variables:
119-
120-
```bash
121-
export http_proxy="Your_HTTP_Proxy"
122-
export https_proxy="Your_HTTPs_Proxy"
123-
```
124-
125-
3. Set up other environment variables:
126-
127-
```bash
128-
source ./docker_compose/set_env.sh
129-
```
130-
131-
### Deploy SearchQnA on Gaudi
132-
133-
If your version of `Habana Driver` < 1.16.0 (check with `hl-smi`), run the following command directly to start SearchQnA services. Find the corresponding [compose.yaml](./docker_compose/intel/hpu/gaudi/compose.yaml).
134-
135-
```bash
136-
cd GenAIExamples/SearchQnA/docker_compose/intel/hpu/gaudi/
137-
docker compose up -d
138-
```
139-
140-
Refer to the [Gaudi Guide](./docker_compose/intel/hpu/gaudi/README.md) to build docker images from source.
141-
142-
### Deploy SearchQnA on Xeon
143-
144-
Find the corresponding [compose.yaml](./docker_compose/intel/cpu/xeon/compose.yaml).
145-
146-
```bash
147-
cd GenAIExamples/SearchQnA/docker_compose/intel/cpu/xeon/
148-
docker compose up -d
149-
```
150-
151-
Refer to the [Xeon Guide](./docker_compose/intel/cpu/xeon/README.md) for more instructions on building docker images from source.
152-
153-
## Consume SearchQnA Service
154-
155-
Two ways of consuming SearchQnA Service:
156-
157-
1. Use cURL command on terminal
158-
159-
```bash
160-
curl http://${host_ip}:3008/v1/searchqna \
161-
-H "Content-Type: application/json" \
162-
-d '{
163-
"messages": "What is the latest news? Give me also the source link.",
164-
"stream": "True"
165-
}'
166-
```
167-
168-
2. Access via frontend
169-
170-
To access the frontend, open the following URL in your browser: http://{host_ip}:5173.
171-
172-
By default, the UI runs on port 5173 internally.
173-
174-
## Troubleshooting
175-
176-
1. If you get errors like "Access Denied", [validate micro service](https://github.com/opea-project/GenAIExamples/tree/main/ChatQnA/docker_compose/intel/cpu/xeon/README.md#validate-microservices) first. A simple example:
95+
This SearchQnA use case performs Search-augmented Question Answering across multiple platforms. Currently, we provide the example for Intel® Gaudi® 2 and Intel® Xeon® Scalable Processors, and we invite contributions from other hardware vendors to expand OPEA ecosystem.
17796

178-
```bash
179-
http_proxy=""
180-
curl http://${host_ip}:3001/embed \
181-
-X POST \
182-
-d '{"inputs":"What is Deep Learning?"}' \
183-
-H 'Content-Type: application/json'
184-
```
97+
## Deployment Options
18598

186-
2. (Docker only) If all microservices work well, check the port ${host_ip}:3008, the port may be allocated by other users, you can modify the `compose.yaml`.
99+
The table below lists the available deployment options and their implementation details for different hardware platforms.
187100

188-
3. (Docker only) If you get errors like "The container name is in use", change container name in `compose.yaml`.
101+
| Category | Deployment Option | Description |
102+
| ---------------------- | ---------------------- | -------------------------------------------------------------- |
103+
| On-premise Deployments | Docker Compose (Xeon) | [DocSum deployment on Xeon](./docker_compose/intel/cpu/xeon) |
104+
| | Docker Compose (Gaudi) | [DocSum deployment on Gaudi](./docker_compose/intel/hpu/gaudi) |
105+
| | Docker Compose (ROCm) | [DocSum deployment on AMD ROCm](./docker_compose/amd/gpu/rocm) |

SearchQnA/README_miscellaneous.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SearchQnA Docker Image Build
2+
3+
## Table of Contents
4+
5+
1. [Build MegaService Docker Image](#build-megaservice-docker-image)
6+
2. [Build UI Docker Image](#build-ui-docker-image)
7+
3. [Generate a HuggingFace Access Token](#generate-a-huggingface-access-token)
8+
4. [Troubleshooting](#troubleshooting)
9+
10+
## Build MegaService Docker Image
11+
12+
To build the SearchQnA Megaservice, use the [GenAIExamples](https://github.com/opea-project/GenAIExamples.git) repository.
13+
Use the following command to build the Megaservice Docker image:
14+
15+
```bash
16+
git clone https://github.com/opea-project/GenAIExamples.git
17+
cd GenAIExamples/SearchQnA
18+
docker build --no-cache -t opea/searchqna:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
19+
```
20+
21+
## Build UI Docker Image
22+
23+
Build frontend Docker image via below command:
24+
25+
```bash
26+
cd GenAIExamples/SearchQnA/ui
27+
docker build -t opea/searchqna-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./docker/Dockerfile .
28+
```
29+
30+
## Generate a HuggingFace Access Token
31+
32+
Some HuggingFace resources require an access token. Developers can create one by first signing up on [HuggingFace](https://huggingface.co/) and then generating a [user access token](https://huggingface.co/docs/transformers.js/en/guides/private#step-1-generating-a-user-access-token).
33+
34+
## Troubleshooting
35+
36+
1. If errors such as "Access Denied" occur, validate the [microservice](https://github.com/opea-project/GenAIExamples/tree/main/ChatQnA/docker_compose/intel/cpu/xeon/README.md#validate-microservices) that is querying the embed API. A simple example:
37+
38+
```bash
39+
http_proxy=""
40+
curl http://${host_ip}:3001/embed \
41+
-X POST \
42+
-d '{"inputs":"What is Deep Learning?"}' \
43+
-H 'Content-Type: application/json'
44+
```
45+
46+
2. (Docker only) If all microservices work well, check the port ${host_ip}:3008, the port might already be in use by another service, you can modify the `compose.yaml`.
47+
48+
3. (Docker only) If you get errors like "The container name is in use", change container name in `compose.yaml`.

0 commit comments

Comments
 (0)