Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sidjha1 committed Oct 1, 2024
1 parent 956549b commit 7d7d11b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/tests/rm_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,24 @@ def test_search_reranker_only(setup_models):
assert df["Course Name"].tolist() == ["Optimization Methods in Engineering", "Probability and Random Processes"]


def test_search(setup_models):
rm, reranker = setup_models
lotus.settings.configure(rm=rm, reranker=reranker)

data = {
"Course Name": [
"Probability and Random Processes",
"Cooking",
"Food Sciences",
"Optimization Methods in Engineering",
]
}
df = pd.DataFrame(data)
df = df.sem_index("Course Name", "index_dir")
df = df.sem_search("Course Name", "Optimization", K=2, n_rerank=1)
assert df["Course Name"].tolist() == ["Optimization Methods in Engineering"]


def test_dedup(setup_models):
rm, _ = setup_models
lotus.settings.configure(rm=rm)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: ruff check .

test:
name: LM and RM Tests
name: Python Tests
runs-on: ubuntu-latest
timeout-minutes: 5

Expand All @@ -57,6 +57,6 @@ jobs:
- name: Run Python tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run:
run: |
pytest .github/tests/lm_tests.py
pytest .github/tests/rm_tests.py

0 comments on commit 7d7d11b

Please sign in to comment.