1010
1111## Deploy On Xeon
1212
13- ```
13+ ``` bash
1414cd GenAIExamples/CodeTrans/kubernetes/manifests/xeon
1515export HUGGINGFACEHUB_API_TOKEN=" YourOwnToken"
1616sed -i " s/insert-your-huggingface-token-here/${HUGGINGFACEHUB_API_TOKEN} /g" codetrans.yaml
@@ -19,7 +19,7 @@ kubectl apply -f codetrans.yaml
1919
2020## Deploy On Gaudi
2121
22- ```
22+ ``` bash
2323cd GenAIExamples/CodeTrans/kubernetes/manifests/gaudi
2424export HUGGINGFACEHUB_API_TOKEN=" YourOwnToken"
2525sed -i " s/insert-your-huggingface-token-here/${HUGGINGFACEHUB_API_TOKEN} /g" codetrans.yaml
@@ -30,12 +30,20 @@ kubectl apply -f codetrans.yaml
3030
3131To verify the installation, run the command ` kubectl get pod ` to make sure all pods are running.
3232
33- Then run the command ` kubectl port-forward svc/docsum 8888:8888 ` to expose the CodeTrans service for access.
33+ Then run the command ` kubectl port-forward svc/codetrans 7777:7777 ` to expose the CodeTrans service for access.
3434
3535Open another terminal and run the following command to verify the service if working:
3636
37- ``` console
37+ ``` bash
3838curl http://localhost:7777/v1/codetrans \
3939 -H ' Content-Type: application/json' \
4040 -d ' {"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}'
4141```
42+
43+ To consume the service using nginx, run the command below. The ` ${host_ip} ` is the external ip of your server.
44+
45+ ``` bash
46+ curl http://${host_ip} :30789/v1/codetrans \
47+ -H ' Content-Type: application/json' \
48+ -d ' {"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}'
49+ ```
0 commit comments