Skip to content

Commit 076bca3

Browse files
dbkinderashahba
andauthored
doc: fix markdown in CodeTrans/README.md (#476)
* fix multiple H1 headings * indent content of ordered list * edit use of please * edit unnecessary use of HTML Signed-off-by: David B. Kinder <[email protected]> Co-authored-by: Abolfazl Shahbazi <[email protected]>
1 parent 83712b9 commit 076bca3

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

CodeTrans/README.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,67 +6,67 @@ The workflow falls into the following architecture:
66

77
![architecture](./assets/img/code_trans_architecture.png)
88

9-
This Code Translation use case uses Text Generation Inference on Intel Gaudi2 or Intel Xeon Scalable Processor. The Intel Gaudi2 accelerator supports both training and inference for deep learning models in particular for LLMs. Please visit [Habana AI products](https://habana.ai/products) for more details.
9+
This Code Translation use case uses Text Generation Inference on Intel Gaudi2 or Intel Xeon Scalable Processor. The Intel Gaudi2 accelerator supports both training and inference for deep learning models in particular for LLMs. Visit [Habana AI products](https://habana.ai/products) for more details.
1010

11-
# Deploy Code Translation Service
11+
## Deploy Code Translation Service
1212

1313
The Code Translation service can be effortlessly deployed on either Intel Gaudi2 or Intel Xeon Scalable Processor.
1414

1515
Currently we support two ways of deploying Code Translation services on docker:
1616

1717
1. Start services using the docker image on `docker hub`:
1818

19-
```bash
20-
docker pull opea/codetrans:latest
21-
```
19+
```bash
20+
docker pull opea/codetrans:latest
21+
```
2222

2323
2. Start services using the docker images `built from source`: [Guide](./docker)
2424

25-
## Setup Environment Variable
25+
### Setup Environment Variable
2626

2727
To set up environment variables for deploying Code Translation services, follow these steps:
2828

2929
1. Set the required environment variables:
3030

31-
```bash
32-
# Example: host_ip="192.168.1.1"
33-
export host_ip="External_Public_IP"
34-
# Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1"
35-
export no_proxy="Your_No_Proxy"
36-
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
37-
```
31+
```bash
32+
# Example: host_ip="192.168.1.1"
33+
export host_ip="External_Public_IP"
34+
# Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1"
35+
export no_proxy="Your_No_Proxy"
36+
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
37+
```
3838

3939
2. If you are in a proxy environment, also set the proxy-related environment variables:
4040

41-
```bash
42-
export http_proxy="Your_HTTP_Proxy"
43-
export https_proxy="Your_HTTPs_Proxy"
44-
```
41+
```bash
42+
export http_proxy="Your_HTTP_Proxy"
43+
export https_proxy="Your_HTTPs_Proxy"
44+
```
4545

4646
3. Set up other environment variables:
4747

48-
```bash
49-
source ./docker/set_env.sh
50-
```
48+
```bash
49+
source ./docker/set_env.sh
50+
```
5151

52-
## Deploy with Docker
52+
### Deploy with Docker
5353

54-
### Deploy Code Translation on Gaudi
54+
#### Deploy Code Translation on Gaudi
5555

56-
Please find corresponding [compose.yaml](./docker/gaudi/compose.yaml).
56+
Find the corresponding [compose.yaml](./docker/gaudi/compose.yaml).
5757

5858
```bash
5959
cd GenAIExamples/CodeTrans/docker/gaudi
6060
docker compose up -d
6161
```
6262

63-
> Notice: Currently only the <b>Habana Driver 1.16.x</b> is supported for Gaudi.
63+
> Notice: Currently only the **Habana Driver 1.16.x** is supported for Gaudi.
6464
65-
Please refer to the [Gaudi Guide](./docker/gaudi/README.md) to build docker images from source.
65+
Refer to the [Gaudi Guide](./docker/gaudi/README.md) to build docker images from source.
6666

67-
### Deploy Code Translation on Xeon
67+
#### Deploy Code Translation on Xeon
6868

69-
Please find corresponding [compose.yaml](./docker/xeon/compose.yaml).
69+
Find the corresponding [compose.yaml](./docker/xeon/compose.yaml).
7070

7171
```bash
7272
cd GenAIExamples/CodeTrans/docker/xeon
@@ -75,50 +75,50 @@ docker compose up -d
7575

7676
Refer to the [Xeon Guide](./docker/xeon/README.md) for more instructions on building docker images from source.
7777

78-
## Deploy using Kubernetes with GMC
78+
### Deploy using Kubernetes with GMC
7979

80-
Please refer to the [Code Translation Kubernetes Guide](./kubernetes/README.md)
80+
Refer to the [Code Translation Kubernetes Guide](./kubernetes/README.md)
8181

82-
## Deploy using Kubernetes without GMC
82+
### Deploy using Kubernetes without GMC
8383

84-
Please refer to the [Code Translation Kubernetes Guide](./kubernetes/manifests/README.md)
84+
Refer to the [Code Translation Kubernetes Guide](./kubernetes/manifests/README.md)
8585

86-
## Deploy CodeTrans into Kubernetes using Helm Chart
86+
### Deploy CodeTrans into Kubernetes using Helm Chart
8787

88-
Install Helm (version >= 3.15) first. Please refer to the [Helm Installation Guide](https://helm.sh/docs/intro/install/) for more information.
88+
Install Helm (version >= 3.15) first. Refer to the [Helm Installation Guide](https://helm.sh/docs/intro/install/) for more information.
8989

9090
Refer to the [CodeTrans helm chart](https://github.com/opea-project/GenAIInfra/tree/main/helm-charts/codetrans) for instructions on deploying CodeTrans into Kubernetes on Xeon & Gaudi.
9191

92-
# Consume Code Translation Service
92+
## Consume Code Translation Service
9393

9494
Two ways of consuming Code Translation Service:
9595

9696
1. Use cURL command on terminal
9797

98-
```bash
99-
curl http://${host_ip}:7777/v1/codetrans \
100-
-H "Content-Type: application/json" \
101-
-d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}'
102-
```
98+
```bash
99+
curl http://${host_ip}:7777/v1/codetrans \
100+
-H "Content-Type: application/json" \
101+
-d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}'
102+
```
103103

104104
2. Access via frontend
105105

106106
To access the frontend, open the following URL in your browser: http://{host_ip}:5173.
107107

108108
By default, the UI runs on port 5173 internally.
109109

110-
# Troubleshooting
110+
## Troubleshooting
111111

112-
1. If you get errors like "Access Denied", please [validate micro service](https://github.com/opea-project/GenAIExamples/tree/main/CodeTrans/docker/xeon#validate-microservices) first. A simple example:
112+
1. If you get errors like "Access Denied", [validate micro service](https://github.com/opea-project/GenAIExamples/tree/main/CodeTrans/docker/xeon#validate-microservices) first. A simple example:
113113

114-
```bash
115-
http_proxy=""
116-
curl http://${host_ip}:8008/generate \
117-
-X POST \
118-
-d '{"inputs":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:","parameters":{"max_new_tokens":17, "do_sample": true}}' \
119-
-H 'Content-Type: application/json'
120-
```
114+
```bash
115+
http_proxy=""
116+
curl http://${host_ip}:8008/generate \
117+
-X POST \
118+
-d '{"inputs":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:","parameters":{"max_new_tokens":17, "do_sample": true}}' \
119+
-H 'Content-Type: application/json'
120+
```
121121

122-
2. (Docker only) If all microservices work well, please check the port ${host_ip}:7777, the port may be allocated by other users, you can modify the `compose.yaml`.
122+
2. (Docker only) If all microservices work well, check the port ${host_ip}:7777, the port may be allocated by other users, you can modify the `compose.yaml`.
123123

124-
3. (Docker only) If you get errors like "The container name is in use", please change container name in `compose.yaml`.
124+
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)