Skip to content

Commit d5a6169

Browse files
authored
docs: update README.md
add instructions to run the model using gradlew
1 parent 4f5fb00 commit d5a6169

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ After running one of the above codes, your ONNX model will be saved in the `onnx
3232

3333
The tokenizer file `tokenizer.json` was taken from this [Hugging Face repository](https://huggingface.co/xlm-roberta-large-finetuned-conll03-english). Download the `tokenizer.json` from this [link](https://huggingface.co/xlm-roberta-large-finetuned-conll03-english/raw/main/tokenizer.json).
3434

35+
Some times, the `tokenizer.json` file is created in onnx conversion process, In that case you can find it in `onnx/` folder.
36+
3537
**Move Files**
3638

3739
Copy the files created from the above steps into the `raw-files` directory as shown in the image below.
@@ -50,6 +52,47 @@ Open the `Main.java` file and click the play button as shown in the red box in t
5052

5153
![how to run project](images/run-code.jpg)
5254

55+
## Run with Gradle
56+
57+
You can build and run the project using the included Gradle wrapper. The Gradle wrapper (`gradlew`) allows you to build and run the project without installing Gradle system-wide.
58+
59+
- **Build the application:**
60+
61+
```bash
62+
./gradlew build
63+
```
64+
65+
- **Run the application:**
66+
67+
```bash
68+
./gradlew run
69+
```
70+
71+
The `run` task will execute the `Main` class defined in the project.
72+
73+
## Install Gradle (optional)
74+
75+
If you want to install Gradle system-wide instead of using the wrapper, here are two common options. Using the Gradle wrapper is recommended for consistent builds.
76+
77+
- **Install via SDKMAN (recommended):**
78+
79+
```bash
80+
curl -s "https://get.sdkman.io" | bash
81+
source "$HOME/.sdkman/bin/sdkman-init.sh"
82+
sdk install gradle
83+
gradle -v
84+
```
85+
86+
- **Install on Debian/Ubuntu (may not be latest):**
87+
88+
```bash
89+
sudo apt update
90+
sudo apt install gradle
91+
gradle -v
92+
```
93+
94+
After installing Gradle, you can run `gradle build` and `gradle run` instead of using `./gradlew`.
95+
5396
## Star History
5497

5598
<a href="https://www.star-history.com/?repos=Ahwar%2FNER-NLP-with-ONNX-Java&type=date&legend=top-left">

0 commit comments

Comments
 (0)