Skip to content

Commit

Permalink
Bumping dependencies and fixing bugs. (#50)
Browse files Browse the repository at this point in the history
bugs fixed:

- svg file not compatible with chrome after the update so changed to png
file
- langchain: pydantic deprecation

Co-authored-by: Amelia Taihui Ye <taihui@umich.edu>
  • Loading branch information
AmeliaYe and AmeliaTaihui authored Oct 10, 2024
1 parent d2302a6 commit 409f868
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion apps/reranker_ms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NAME="${SVC_NAME}"

# workspace configuration options
MODEL=$(config_lkp "${SLUG}_MODEL" "nvidia/nv-rerankqa-mistral-4b-v3")
TAG=$(config_lkp "${SLUG}_NIM_VERSION" "1.0.1")
TAG=$(config_lkp "${SLUG}_NIM_VERSION" "1.0.2")
GPUS=$(config_lkp "${SLUG}_NIM_GPUS" "all")
IMAGE="nvcr.io/nim/$MODEL"

Expand Down
6 changes: 2 additions & 4 deletions code/chain_server/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from operator import itemgetter

from langchain.pydantic_v1 import BaseModel
from langchain.retrievers import ContextualCompressionRetriever
from langchain_community.chat_message_histories import RedisChatMessageHistory
from langchain_core.documents import Document
Expand All @@ -27,6 +26,7 @@
from langchain_core.runnables.history import RunnableWithMessageHistory
from langchain_milvus.vectorstores.milvus import Milvus
from langchain_nvidia_ai_endpoints import ChatNVIDIA, NVIDIAEmbeddings, NVIDIARerank
from pydantic import BaseModel

from . import prompts
from .configuration import config as app_config
Expand Down Expand Up @@ -130,9 +130,7 @@ class ChainInputs(BaseModel):
input_messages_key="question",
output_messages_key="output",
history_messages_key="history",
custom_input_type=ChainInputs,
custom_output_type=ChainOutputs,
)
).with_types(input_type=ChainInputs)

# %% uncomment this line to print the chain architecture on startup
# chain.get_graph().print_ascii()
3 changes: 3 additions & 0 deletions code/frontend/_static/images/bot_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions code/frontend/_static/images/bot_icon.svg

This file was deleted.

3 changes: 3 additions & 0 deletions code/frontend/_static/images/floppy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions code/frontend/_static/images/floppy.svg

This file was deleted.

3 changes: 3 additions & 0 deletions code/frontend/_static/images/history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions code/frontend/_static/images/history.svg

This file was deleted.

3 changes: 3 additions & 0 deletions code/frontend/_static/images/undo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions code/frontend/_static/images/undo.svg

This file was deleted.

3 changes: 3 additions & 0 deletions code/frontend/_static/images/user_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions code/frontend/_static/images/user_icon.svg

This file was deleted.

4 changes: 2 additions & 2 deletions code/frontend/pages/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
with open(_CSS_FILE, "r", encoding="UTF-8") as css_file:
_CSS = css_file.read()
_AVATAR_IMAGES = (
IMG_DIR.joinpath("user_icon.svg"),
IMG_DIR.joinpath("bot_icon.svg"),
IMG_DIR.joinpath("user_icon.png"),
IMG_DIR.joinpath("bot_icon.png"),
)
_JS_FILE = Path(__file__).parent.joinpath("scripts.js")
with open(_JS_FILE, "r", encoding="UTF-8") as js_file:
Expand Down
6 changes: 3 additions & 3 deletions code/frontend/pages/control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
if (! title.innerHTML.endsWith("🟢")) { title.innerHTML = title.innerHTML.slice(0,-2) + "🟢"; };
}
"""
_SAVE_IMG = IMG_DIR.joinpath("floppy.svg")
_UNDO_IMG = IMG_DIR.joinpath("undo.svg")
_HISTORY_IMG = IMG_DIR.joinpath("history.svg")
_SAVE_IMG = IMG_DIR.joinpath("floppy.png")
_UNDO_IMG = IMG_DIR.joinpath("undo.png")
_HISTORY_IMG = IMG_DIR.joinpath("history.png")
_PSEUDO_FILE_NAME = "config.yaml 🟢"
with open(config.chain_config_file, "r", encoding="UTF-8") as config_file:
_STARTING_CONFIG = config_file.read()
Expand Down
23 changes: 12 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
confz==2.0.1
fastapi==0.112.0
gradio==4.40.0
fastapi==0.115.0
gradio==4.44.1
grandalf==0.8
jupyterlab>3.0
langchain==0.2.12
langchain-milvus==0.1.3
langchain-nvidia-ai-endpoints==0.2.0
langchain-openai==0.1.20
langserve==0.2.2
opentelemetry-instrumentation-fastapi==0.47b0
langchain==0.3.3
langchain-community==0.3.1
langchain-milvus==0.1.5
langchain-nvidia-ai-endpoints==0.3.0
langchain-openai==0.2.2
langserve==0.3.0
opentelemetry-instrumentation-fastapi==0.48b0
pydantic
pymilvus==2.4.4
redis==5.0.8
pymilvus==2.4.7
redis==5.1.1
sse-starlette==2.1.3
uvicorn==0.30.5
uvicorn==0.31.0
watchfiles==0.24.0

0 comments on commit 409f868

Please sign in to comment.