Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
laugustyniak committed Jul 5, 2024
1 parent 555d6a2 commit ceda390
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions dashboards/pages/01_🔍_Search_Judgements.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def get_embedding_model() -> Any:

with st.form(key="search_form"):
query = st.text_area("What you are looking for in the judgements?")
max_judgements = st.slider(
"Max judgements to show", min_value=1, max_value=20, value=5
)
max_judgements = st.slider("Max judgements to show", min_value=1, max_value=20, value=5)
submit_button = st.form_submit_button(label="Search")

if submit_button:
Expand Down
4 changes: 1 addition & 3 deletions juddges/data/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def update_func (document: dict[str, Any]) -> dict[str, Any]:
- Update is called specified documents.
"""

def __init__(
self, mongo_uri: str, update_func: Callable[[dict[str, Any]], dict]
) -> None:
def __init__(self, mongo_uri: str, update_func: Callable[[dict[str, Any]], dict]) -> None:
self.mongo_uri = mongo_uri
self.update_func = update_func

Expand Down
6 changes: 2 additions & 4 deletions juddges/retrieval/mongo_hybrid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def run_hybrid_search(
text_priority: float = 1,
):
num_candidates = limit * 10

vector_search = {
"$vectorSearch": {
"index": "vector_index",
Expand All @@ -25,9 +25,7 @@ def run_hybrid_search(

def make_compute_score_doc(priority, score_field_name):
return {
"$addFields": {
score_field_name: {"$divide": [1.0, {"$add": ["$rank", priority, 1]}]}
}
"$addFields": {score_field_name: {"$divide": [1.0, {"$add": ["$rank", priority, 1]}]}}
}

def make_projection_doc(score_field_name):
Expand Down
1 change: 1 addition & 0 deletions scripts/sft/fine_tune_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Fine-tune a large language model using SFT.
the script is based on: https://www.philschmid.de/fine-tune-llms-in-2024-with-trl
"""

import os
from pathlib import Path

Expand Down

0 comments on commit ceda390

Please sign in to comment.