Skip to content

Commit

Permalink
FEAT: Add docker file fastapi
Browse files Browse the repository at this point in the history
  • Loading branch information
thinley4 committed Oct 27, 2024
1 parent 57219d6 commit eaa6d7b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 58 deletions.
11 changes: 11 additions & 0 deletions fastapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.10

WORKDIR /app/fastapi

COPY ./requirements.txt /app/fastapi/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /app/fastapi/requirements.txt

COPY . /app/fastapi/

CMD ["python", "main.py"]
8 changes: 0 additions & 8 deletions fastapi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

from langchain_mistralai import ChatMistralAI

from langchain_core.messages import HumanMessage
from langchain_core.chat_history import InMemoryChatMessageHistory

from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.runnables.history import RunnableWithMessageHistory
from fastapi.middleware.cors import CORSMiddleware
Expand All @@ -31,15 +28,10 @@

from langchain_community.chat_message_histories import ChatMessageHistory

from langchain_core.messages import HumanMessage


load_dotenv()

# Secret keys

secretAPI = os.getenv("MISTRAL_API_KEY")

class Item(BaseModel):
question: str
collectionName: str
Expand Down
94 changes: 44 additions & 50 deletions fastapi/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,84 +1,78 @@
aiohappyeyeballs==2.4.0
aiohttp==3.10.5
aiohappyeyeballs==2.4.3
aiohttp==3.10.10
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.4.0
anyio==4.6.2.post1
attrs==24.2.0
certifi==2024.8.30
charset-normalizer==3.3.2
charset-normalizer==3.4.0
click==8.1.7
dataclasses-json==0.6.7
fastapi==0.114.2
filelock==3.16.0
frozenlist==1.4.1
fsspec==2024.9.0
greenlet==3.1.0
fastapi==0.115.3
filelock==3.16.1
frozenlist==1.5.0
fsspec==2024.10.0
greenlet==3.1.1
h11==0.14.0
httpcore==1.0.5
httpcore==1.0.6
httpx==0.27.2
httpx-sse==0.4.0
huggingface-hub==0.24.7
idna==3.9
huggingface-hub==0.26.1
idna==3.10
Jinja2==3.1.4
joblib==1.4.2
jsonpatch==1.33
jsonpointer==3.0.0
langchain==0.3.0
langchain-community==0.3.0
langchain-core==0.3.0
langchain==0.3.4
langchain-community==0.3.3
langchain-core==0.3.13
langchain-huggingface==0.1.0
langchain-mistralai==0.2.0
langchain-postgres==0.0.12
langchain-text-splitters==0.3.0
langsmith==0.1.120
MarkupSafe==2.1.5
marshmallow==3.22.0
langsmith==0.1.137
MarkupSafe==3.0.2
marshmallow==3.23.0
mpmath==1.3.0
multidict==6.1.0
mypy-extensions==1.0.0
networkx==3.3
networkx==3.4.2
numpy==1.26.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.20.5
nvidia-nvjitlink-cu12==12.6.68
nvidia-nvtx-cu12==12.1.105
orjson==3.10.7
orjson==3.10.10
packaging==24.1
pillow==10.4.0
pydantic==2.9.1
pydantic-settings==2.5.2
pydantic_core==2.23.3
pypdf==4.3.1
pgvector==0.2.5
pillow==11.0.0
propcache==0.2.0
psycopg==3.2.3
psycopg-pool==3.2.3
pydantic==2.9.2
pydantic-settings==2.6.0
pydantic_core==2.23.4
PyPDF2==3.0.1
python-dotenv==1.0.1
python-multipart==0.0.12
PyYAML==6.0.2
regex==2024.9.11
requests==2.32.3
requests-toolbelt==1.0.0
safetensors==0.4.5
scikit-learn==1.5.2
scipy==1.14.1
sentence-transformers==3.1.0
setuptools==74.1.2
sentence-transformers==3.2.1
setuptools==75.2.0
sniffio==1.3.1
SQLAlchemy==2.0.34
starlette==0.38.5
sympy==1.13.2
tenacity==8.5.0
SQLAlchemy==2.0.36
starlette==0.41.2
sympy==1.13.1
tenacity==9.0.0
threadpoolctl==3.5.0
tokenizers==0.19.1
torch==2.4.1
tokenizers==0.20.1
torch==2.5.0
tqdm==4.66.5
transformers==4.44.2
triton==3.0.0
transformers==4.46.0
triton==3.1.0
typing-inspect==0.9.0
typing_extensions==4.12.2
unicorn==2.0.1.post1
urllib3==2.2.3
uvicorn==0.30.6
yarl==1.11.1
uvicorn==0.32.0
yarl==1.16.0

0 comments on commit eaa6d7b

Please sign in to comment.