Skip to content

Commit

Permalink
connect lancedb
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkolo committed Sep 1, 2024
1 parent 51fa5eb commit 8a5ddae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
rev: v4.6.0
hooks:
- id: check-added-large-files # Prevent giant files from being committed.
args: ['--maxkb=32000'] # default 500kb
args: ['--maxkb=600'] # default 500kb
- id: check-ast # Simply check whether files parse as valid python.
- id: check-json # Attempts to load all json files to verify syntax.
- id: check-merge-conflict
Expand Down
8 changes: 5 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
- save user feedback & chat history into database
"""

from typing import Any
from collections.abc import Iterable
from typing import Any

import streamlit as st
from lancedb.table import Table
from PIL import Image

import src.constants as cst
from src.app_utils import connect_to_llm, init_st_keys
from src.app_widgets import create_button, create_chat_msg, create_first_assistant_msg, show_chat_history, show_md_file
from src.llm_api import build_full_llm_chat_input, stream_chat_response
from src.prompt_building import WELCOME_MSG
from src.retrieval import get_knowledge_base

# Chat Parameters
# -----------------------------
Expand Down Expand Up @@ -103,8 +105,8 @@ def process_user_input(user_prompt: str, avatars: dict[str, Any], api_name: str,
# Get Knowledge Base
# ------------
init_st_keys("kbase_loaded", False)
# k_base: Table = get_knowledge_base()
# st.session_state["kbase_loaded"] = True
k_base: Table = get_knowledge_base()
st.session_state["kbase_loaded"] = True


# Top Container
Expand Down
2 changes: 1 addition & 1 deletion src/llm_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Any
from collections.abc import Iterable
from typing import Any

import requests
import streamlit as st
Expand Down

0 comments on commit 8a5ddae

Please sign in to comment.