Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/20 start spotlight from docker #21

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN pip install -IU pip setuptools wheel && pip install poetry==1.8.3
COPY pyproject.toml poetry.lock README.md ./
COPY ./assistant/__init__.py ./assistant/

RUN poetry install --extras=openai --sync --without=dev
RUN poetry install --all-extras --sync --without=dev

COPY ./assistant/ ./assistant/
COPY settings.yaml ./
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ build-image: ## Build docker image
.PHONY: run-image-openai
run-image-openai: ## Build docker image
run-image-openai: build-image
docker run -it --rm -e OPENAI_API_KEY=$$OPENAI_API_KEY -p 8000:8000 renumics-rag
docker run -it --rm -p 8000:8000 -p 8001:8001 --network=host -e OPENAI_API_KEY=$$OPENAI_API_KEY renumics-rag

.PHONY: run-image-azure
run-image-azure: ## Build docker image
run-image-azure: build-image
docker run -it --rm \
docker run -it --rm -p 8000:8000 -p 8001:8001 --network=host \
-e OPENAI_API_TYPE=$$OPENAI_API_TYPE \
-e OPENAI_API_VERSION=$$OPENAI_API_VERSION \
-e AZURE_OPENAI_API_KEY=$$AZURE_OPENAI_API_KEY \
-e AZURE_OPENAI_ENDPOINT=$$AZURE_OPENAI_ENDPOINT -p 8000:8000 renumics-rag
-e AZURE_OPENAI_ENDPOINT=$$AZURE_OPENAI_ENDPOINT \
renumics-rag

.PHONY: docker-login
docker-login: ## Log in to Azure registry
Expand Down
3 changes: 1 addition & 2 deletions assistant/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Any, Callable, Dict, List, Optional, Type, Union, get_args

import pandas as pd
import streamlit as st
import typer
from langchain.vectorstores.chroma import Chroma
Expand Down Expand Up @@ -115,7 +114,7 @@ def get_or_create_spotlight_viewer() -> Any:
viewer.close()
return spotlight.viewers()[-1]
return spotlight.show(
pd.DataFrame({}), # Hack for Spotlight
port=8001,
no_browser=True,
dtype={
"used_by_questions": spotlight_dtypes.SequenceDType(
Expand Down