File tree Expand file tree Collapse file tree 3 files changed +49
-5
lines changed
Expand file tree Collapse file tree 3 files changed +49
-5
lines changed Original file line number Diff line number Diff line change 1+ name : build and release
2+
3+ on :
4+ push :
5+ branches : [master]
6+ release :
7+ types : [created]
8+
9+ env :
10+ RUST_BACKTRACE : full
11+
12+ jobs :
13+ build-and-release :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v2
18+
19+ - name : Install Rust
20+ uses : actions-rs/toolchain@v1
21+ with :
22+ profile : minimal
23+ toolchain : stable
24+
25+ - name : Build
26+ run : cargo build --release --verbose
27+
28+ - name : Archive binary
29+ uses : actions/upload-artifact@v2
30+ with :
31+ name : tg_antispam_rs
32+ path : target/release/tg_antispam_rs
33+
34+ - name : Create release
35+ uses : softprops/action-gh-release@v1
36+ if : github.event_name == 'release'
37+ env :
38+ GITHUB_TOKEN : ${{ secrets.SECRET_TOKEN }}
39+ with :
40+ files : target/release/tg_antispam_rs
41+ tag_name : ${{ github.ref }}
42+ name : Release ${{ github.ref }}
43+ body : ${{ github.event.release.body }}
44+ draft : false
45+ prerelease : false
Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ FROM debian:buster-slim
1616COPY --from=rust-builder /usr/src/app/target/release/tg_antispam_rs /usr/local/bin/
1717WORKDIR /usr/local/bin
1818
19- RUN apt-get update
20- RUN apt-get install wget -y
21- RUN wget "https://huggingface.co/datasets/thehamkercat/telegram-spam-ham/raw/main/dataset.csv"
19+
20+ ADD https://huggingface.co/datasets/thehamkercat/telegram-spam-ham/raw/main/dataset.csv dataset.csv
2221
2322CMD ["tg_antispam_rs" ]
Original file line number Diff line number Diff line change 88- The dataset provided may contain some NSFW texts or personal info, it's not thoroughly checked.
99- I've included a docker-based example, but you can run it without docker as well.
1010- ` profanity ` in response is only there to maintain backwards compatibility for ARQ users, it always returns ` false `
11-
1211## Installation:
1312I would suggest using docker compose for this, but it's upto you!
1413### With Docker compose
@@ -51,8 +50,9 @@ content-type: application/json
5150 "spam_probability": 99
5251}
5352```
53+ ### A Go port for the same API can be found [ here] ( https://github.com/axrav/AntispamAPI )
5454
55- ## Usage example :
55+ ## Usage examples :
5656### Python
5757
5858``` python
You can’t perform that action at this time.
0 commit comments