Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/new library #1

Merged
merged 13 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Tests'

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
strategy:
matrix:
go: [ '1.20' ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run tests
run: go test -covermode=atomic -coverprofile=coverage.txt -timeout 5m -json -v ./... | gotestfmt -showteststatus
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ vendor
*.pprof
debug


# Created by https://www.gitignore.io/api/go,vim,c++,java,cuda,python,eclipse,intellij,sublimetext,visualstudio,visualstudiocode

### C++ ###
Expand Down Expand Up @@ -687,5 +686,6 @@ paket-files/

# End of https://www.gitignore.io/api/go,vim,c++,java,cuda,python,eclipse,intellij,sublimetext,visualstudio,visualstudiocode


main

fast_bind
86 changes: 75 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,78 @@
{
"files.associations": {
"*.mc": "cpp",
"*.cu": "cpp",
"*.m": "mathematica",
"*.mt": "mathematica",
"*.hpp": "cpp",
"*.cuh": "cuda",
"__locale": "cpp",
"ios": "cpp",
"memory": "cpp",
"utility": "cpp"
"*main.yml": "ansible",
"*.mc": "cpp",
"*.cu": "cpp",
"*.m": "mathematica",
"*.mt": "mathematica",
"*.hpp": "cpp",
"*.cuh": "cuda",
"__locale": "cpp",
"ios": "cpp",
"memory": "cpp",
"utility": "cpp",
"iomanip": "cpp",
"cmath": "cpp",
"array": "cpp",
"string_view": "cpp",
"initializer_list": "cpp",
"ranges": "cpp",
"span": "cpp",
"string": "cpp",
"stdexcept": "cpp",
"any": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"concepts": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"fstream": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"semaphore": "cpp",
"sstream": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp",
"valarray": "cpp"
}
}
}
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ BINARY_UNIX=$(BINARY_NAME)_unix
all: clean test
build:
$(GOBUILD) -o $(BINARY_NAME) -v

test:
go run cli/main.go predict -m ../service/chat-quality/tools/ml/fasttext/model.bin "i accidentally shrunk my shrinky dink lol </s>"
echo "i accidentally shrunk my shrinky dink lol" | ./fastText/fasttext predict-prob ../service/chat-quality/tools/ml/fasttext/model.bin -
go run cli/main.go sentence -m ../service/chat-quality/tools/ml/fasttext/model.bin "i accidentally shrunk my shrinky dink lol </s>"
echo "i accidentally shrunk my shrinky dink lol" | ./fastText/fasttext print-sentence-vectors ../service/chat-quality/tools/ml/fasttext/model.bin

clean:
rm -rf ~/Library/Caches/go-build/
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)

run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)

copy-fastText:
cp -r $(PWD)/fastText/src/* ./fastText-src/
2 changes: 1 addition & 1 deletion analog.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

type Analog struct {
Name string `json:"name"`
Index int `json:"index"`
Name string `json:"name"`
Probability float32 `json:"probability"`
}

Expand Down
Loading