Skip to content

Commit 9160926

Browse files
committed
Allow use_scalar via env variable
Signed-off-by: Jael Gu <[email protected]>
1 parent 082a9c5 commit 9160926

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+890
-389
lines changed

.github/mergify.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
pull_request_rules:
2+
- name: Add needs-dco label when DCO check failed
3+
conditions:
4+
- or:
5+
- base=main
6+
- base=dev
7+
- -status-success=DCO
8+
actions:
9+
label:
10+
remove:
11+
- dco-passed
12+
add:
13+
- needs-dco
14+
15+
- name: Add dco-passed label when DCO check passed
16+
conditions:
17+
- or:
18+
- base=main
19+
- base=dev
20+
- status-success=DCO
21+
actions:
22+
label:
23+
remove:
24+
- needs-dco
25+
add:
26+
- dco-passed
27+
28+
# - name: Blocking PR if missing a related issue or PR doesn't have kind/improvement label
29+
# conditions:
30+
# - base=main
31+
# - and:
32+
# - -body~=\#[0-9]{1,6}(\s+|$)
33+
# - -body~=https://github.com/zilliztech/GPTCache/issues/[0-9]{1,6}(\s+|$)
34+
# - -label=kind/improvement
35+
# - -title~=\[automated\]
36+
# actions:
37+
# label:
38+
# add:
39+
# - do-not-merge/missing-related-issue
40+
# comment:
41+
# message: |
42+
# @{{author}} Please associate the related issue to the body of your Pull Request. (eg. “issue: #<xyz>”)
43+
44+
# - name: Dismiss block label if related issue be added into PR
45+
# conditions:
46+
# - base=main
47+
# - or:
48+
# - or:
49+
# - body~=\#[0-9]{1,6}(\s+|$)
50+
# - body~=https://github.com/milvus-io/knowhere/issues/[0-9]{1,6}(\s+|$)
51+
# - label=kind/improvement
52+
# actions:
53+
# label:
54+
# remove:
55+
# - do-not-merge/missing-related-issue
56+
57+
- name: Test passed for code changed
58+
conditions:
59+
- or:
60+
- base=main
61+
- base=dev
62+
- "status-success=pylint"
63+
- "status-success=unit-test"
64+
- "status-success=codecov/patch"
65+
- "status-success=codecov/project"
66+
actions:
67+
label:
68+
add:
69+
- ci-passed
70+
71+
- name: Test passed for title skip ci
72+
conditions:
73+
- or:
74+
- base=main
75+
- title~=\[skip ci\]
76+
- -files~=^(?=.*((\.(sh|py)|Makefile))).*$
77+
actions:
78+
label:
79+
add:
80+
- ci-passed
81+
82+
- name: Test passed for markdown file
83+
conditions:
84+
- or:
85+
- base=main
86+
- files=^.*\.md$
87+
actions:
88+
label:
89+
add:
90+
- ci-passed
91+
92+
- name: Remove ci-passed label when ut failed for main
93+
conditions:
94+
- or:
95+
- base=main
96+
- or:
97+
- "status-success!=pylint"
98+
- "status-success!=unit-test"
99+
- files~=^(?=.*((\.(sh|py)|Makefile))).*$
100+
actions:
101+
label:
102+
remove:
103+
- ci-passed

.github/stale.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an issue becomes stale
4+
daysUntilStale: 30
5+
# Number of days of inactivity before a stale issue is closed
6+
daysUntilClose: 7
7+
# Issues with these labels will never be considered stale
8+
exemptLabels:
9+
- priority/critical-urgent
10+
- priority/important-longterm
11+
# Label to use when marking an issue as stale
12+
staleLabel: stale
13+
# Comment to post when marking an issue as stale. Set to `false` to disable
14+
markComment: >
15+
This issue has been automatically marked as stale because it has not had
16+
recent activity. It will be closed if no further activity occurs. Thank you
17+
for your contributions.
18+
Rotten issues close after 30d of inactivity.
19+
Close the stale issues and pull requests after 7 days of inactivity.
20+
Reopen the issue with `/reopen`.
21+
# Comment to post when closing a stale issue. Set to `false` to disable
22+
closeComment: false

.github/workflows/unit_test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Unit test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
# file paths to consider in the event
9+
paths:
10+
- '**.py'
11+
- '!**.md'
12+
- 'tests/**'
13+
- '.github/workflows/unit_test.yml'
14+
15+
jobs:
16+
run:
17+
runs-on: ubuntu-20.04
18+
19+
steps:
20+
- uses: actions/checkout@main
21+
22+
- name: Set up Python 3.8
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: 3.8
26+
cache: pip
27+
- name: Install dependency
28+
shell: bash
29+
run: |
30+
pip install --upgrade pip
31+
pip install coverage
32+
pip install pytest
33+
pip install -r requirements.txt
34+
- name: Install test dependency
35+
shell: bash
36+
working-directory: tests
37+
run: |
38+
pip install -r requirements.txt
39+
- name: Generate coverage report
40+
run: |
41+
rm -rf ./coverage.xml
42+
coverage erase
43+
coverage run -m pytest
44+
coverage xml
45+
- name: Upload coverage to Codecov
46+
uses: codecov/[email protected]
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
files: ./coverage.xml
50+
fail_ci_if_error: true

Contributing.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
We extend a warm invitation to contribute to Akcio by submitting issues, responding to queries, enhancing documentation, and sharing code. Irrespective of the nature of your contribution, we request you to practice professionalism and respectfulness.
2+
3+
## Submitting issues
4+
5+
If you have found a bug or have a feature request, please [submit an issue](https://github.com/zilliztech/akcio/issues) on our GitHub repository.
6+
Here are some guidelines to follow when submitting an issue:
7+
8+
1. Check if the issue has already been reported. If it has, you can add your input by commenting on the issue.
9+
10+
2. Provide a clear and concise description of the issue you are experiencing.
11+
12+
3. Include any relevant details such as error messages, steps to reproduce the issue, and the version of Akcio you are using.
13+
14+
4. If possible, provide a code snippet that can help us reproduce the issue.
15+
16+
17+
## Improving documentation
18+
19+
Good documentation is essential for any project, and Akcio is no exception.
20+
The Akcio documentation contains both **READMEs** and **[Wiki pages](https://github.com/zilliztech/akcio/wiki)**.
21+
If you see an area of the documentation that can be improved, please feel free to submit a pull request with your changes.
22+
23+
## Contributing to modules
24+
25+
You are welcome to share customized methods for each module:
26+
27+
- **agent**: sharing prompt templates, building a new agent, etc.
28+
- **embedding**: using a different tool or service
29+
- **llm**: adding a new model or service
30+
- **store**: enabling more configurations, integrating with other databases, etc.
31+
- **data loader**: cutomizing splitter, processing documents with additional steps, etc.
32+
33+
To ensure seamless integration of a new module into the system, adherence to the [Customization Guides](https://github.com/zilliztech/akcio/wiki#customization) is recommended.
34+
35+
36+
37+
## Pull requests
38+
39+
We follow a fork-and-pull model for all contributions. Before starting, we strongly recommend looking through existing PRs so you can get a feel for things.
40+
41+
If you're interested in contributing to the `zilliztech/akcio` codebase, follow these steps:
42+
43+
1. Fork [Akcio](https://github.com/zilliztech/akcio). If you've forked Akcio already, simply fetch the latest changes from upstream.
44+
45+
2. Clone your forked version of Towhee.
46+
47+
```bash
48+
$ git clone https://github.com/<your_username>/akcio.git
49+
$ cd akcio
50+
```
51+
52+
If you've done this step before, make sure you're on the `master` branch and sync your changes.
53+
54+
```bash
55+
$ git checkout master
56+
$ git pull origin master
57+
```
58+
59+
3. Think up a suitable name for your update, bugfix, or feature. Try to avoid using branch names you've already used in the past.
60+
61+
```bash
62+
$ git checkout -b my-creative-branch-name
63+
```
64+
65+
4. During development, you might want to run `pylint`. You can do so with one of the commands below:
66+
```bash
67+
$ pip install pylint==2.10.2
68+
$ pylint --rcfile=.pylintrc --output-format=colorized src_towhee
69+
$ pylint --rcfile=.pylintrc --output-format=colorized src_langchain
70+
$ pylint --rcfile=.pylintrc --output-format=colorized offline_tools
71+
```
72+
73+
6. Submit your pull request on Github. Folks in the community will discuss your pull request, and maintainers might ask you for some changes. This happens very frequently (including maintainers themselves), so don't worry if it happens to you as well.
74+
75+
> Please ensure that the first line of your PR is as follows:
76+
>
77+
> Signed-off-by: Your Name [email protected]
78+
79+
80+
Thank you for your interest in contributing to Akcio. We appreciate all contributions and look forward to working with you!

config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252

5353
################## Store ##################
54-
USE_SCALAR = os.getenv('USE_SCALAR', False)
54+
USE_SCALAR = True if os.getenv('USE_SCALAR', 'False').lower() == 'true' else False
5555

5656
# Vector db configs
5757
VECTORDB_CONFIG = {

gradio_demo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
'The service should start with either "--langchain" or "--towhee".'
1818

1919
if USE_LANGCHAIN:
20-
from src_langchain.operations import chat, insert, check, drop, get_history, clear_history
20+
from src_langchain.operations import chat, insert, check, drop, get_history, clear_history # pylint: disable=C0413
2121
if USE_TOWHEE:
22-
from src_towhee.operations import chat, insert, check, drop, get_history, clear_history
22+
from src_towhee.operations import chat, insert, check, drop, get_history, clear_history # pylint: disable=C0413
2323

2424

2525
def create_session_id():

main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
'The service should start with either "--langchain" or "--towhee".'
2020

2121
if USE_LANGCHAIN:
22-
from src_langchain.operations import chat, insert, drop
22+
from src_langchain.operations import chat, insert, drop # pylint: disable=C0413
2323
if USE_TOWHEE:
24-
from src_towhee.operations import chat, insert, drop
24+
from src_towhee.operations import chat, insert, drop # pylint: disable=C0413
2525

2626
app = FastAPI()
2727
origins = ['*']

0 commit comments

Comments
 (0)