-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Translation] Support manifests and nginx (#812)
Signed-off-by: letonghan <[email protected]> Signed-off-by: root <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b205dc7
commit 1e13031
Showing
15 changed files
with
1,422 additions
and
37 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ | |
/ChatQnA/ [email protected] | ||
/CodeGen/ [email protected] | ||
/CodeTrans/ [email protected] | ||
/DocSum/ sihan.chen@intel.com | ||
/DocSum/ letong.han@intel.com | ||
/DocIndexRetriever/ [email protected] [email protected] | ||
/FaqGen/ [email protected] | ||
/SearchQnA/ letong.han@intel.com | ||
/SearchQnA/ sihan.chen@intel.com | ||
/Translation/ [email protected] | ||
/VisualQnA/ [email protected] | ||
/ProductivitySuite/ [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
export LLM_MODEL_ID="haoranxu/ALMA-13B" | ||
export TGI_LLM_ENDPOINT="http://${host_ip}:8008" | ||
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token} | ||
export MEGA_SERVICE_HOST_IP=${host_ip} | ||
export LLM_SERVICE_HOST_IP=${host_ip} | ||
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/translation" | ||
export NGINX_PORT=80 | ||
export FRONTEND_SERVICE_IP=${host_ip} | ||
export FRONTEND_SERVICE_PORT=5173 | ||
export BACKEND_SERVICE_NAME=translation | ||
export BACKEND_SERVICE_IP=${host_ip} | ||
export BACKEND_SERVICE_PORT=8888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Deploy Translation in Kubernetes Cluster | ||
|
||
> [NOTE] | ||
> The following values must be set before you can deploy: | ||
> HUGGINGFACEHUB_API_TOKEN | ||
> | ||
> You can also customize the "MODEL_ID" if needed. | ||
> | ||
> You need to make sure you have created the directory `/mnt/opea-models` to save the cached model on the node where the Translation workload is running. Otherwise, you need to modify the `translation.yaml` file to change the `model-volume` to a directory that exists on the node. | ||
## Deploy On Xeon | ||
|
||
``` | ||
cd GenAIExamples/Translation/kubernetes/intel/cpu/xeon/manifests | ||
export HUGGINGFACEHUB_API_TOKEN="YourOwnToken" | ||
sed -i "s/insert-your-huggingface-token-here/${HUGGINGFACEHUB_API_TOKEN}/g" translation.yaml | ||
kubectl apply -f translation.yaml | ||
``` | ||
|
||
## Deploy On Gaudi | ||
|
||
``` | ||
cd GenAIExamples/Translation/kubernetes/intel/hpu/gaudi/manifests | ||
export HUGGINGFACEHUB_API_TOKEN="YourOwnToken" | ||
sed -i "s/insert-your-huggingface-token-here/${HUGGINGFACEHUB_API_TOKEN}/g" translation.yaml | ||
kubectl apply -f translation.yaml | ||
``` | ||
|
||
## Verify Services | ||
|
||
To verify the installation, run the command `kubectl get pod` to make sure all pods are running. | ||
|
||
Then run the command `kubectl port-forward svc/translation 8888:8888` to expose the Translation service for access. | ||
|
||
Open another terminal and run the following command to verify the service if working: | ||
|
||
```console | ||
curl http://localhost:8888/v1/translation \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{"language_from": "Chinese","language_to": "English","source_language": "我爱机器翻译。"}' | ||
``` |
Oops, something went wrong.