Skip to content
Open
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 .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
branch = main
[submodule "lollms_core"]
path = lollms_core
url = https://github.com/ParisNeo/lollms.git
url = https://github.com/ba2512005/lollms.git
branch = main
[submodule "utilities/safe_store"]
path = utilities/safe_store
Expand Down
41 changes: 23 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set the working directory in the container
WORKDIR /app
# Use a multi-stage build to reduce image size and improve security
FROM python:3.11-slim AS builder

# Install system dependencies
# Install system dependencies for building
RUN apt-get update && apt-get install -y \
git \
curl \
Expand All @@ -16,31 +13,39 @@ RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.s
&& rm Miniconda3-latest-Linux-x86_64.sh

# Add Conda to PATH
ENV PATH /opt/conda/bin:$PATH
ENV PATH $PATH:/opt/conda/bin

# Create and activate Conda environment
RUN conda create --name lollms_env python=3.11 git pip -y
SHELL ["conda", "run", "-n", "lollms_env", "/bin/bash", "-c"]

# Clone the repository
RUN git clone --depth 1 --recurse-submodules https://github.com/ParisNeo/lollms-webui.git \
&& cd lollms-webui/lollms_core \
&& pip install -e . \
&& cd ../.. \
&& cd lollms-webui/utilities/pipmaster \
&& pip install -e . \
&& cd ../..
WORKDIR /app
RUN git clone --depth 1 --recurse-submodules https://github.com/ba2512005/lollms-webui.git \
&& cd lollms-webui \
&& conda run -n lollms_env bash -c "pip install -e ."

# Install project dependencies
WORKDIR /app/lollms-webui
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# Copy the rest of the application code
COPY . .

# Build-time optimizations to reduce image size
#RUN find /app -type f | xargs grep -oE '\n\s+$' | sed 's/^/rm /' | bash \
# && rm -rf /var/lib/apt/lists/* \
# && conda clean -a
RUN conda clean -a
# Final stage: production-ready environment
FROM python:3.11-slim

# Set working directory and copy application code
WORKDIR /app
COPY --from=builder /app/lollms-webui .

# Expose port 9600
EXPOSE 9600

# Set the default command to run the application
CMD ["python", "app.py"]
# Set default command to run the application
CMD ["python", "app.py"]
1 change: 0 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import time
from typing import List, Tuple

from fastapi.middleware.cors import CORSMiddleware
from lollms.utilities import PackageManager

os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
Expand Down
7 changes: 1 addition & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,21 @@ GitPython
ascii-colors>=0.4.2
beautifulsoup4
packaging

fastapi
uvicorn
python-multipart
python-socketio
python-socketio[client]
python-socketio[asyncio_client]

pydantic
selenium
tiktoken

pipmaster>=0.1.7

lollmsvectordb>=1.1.0
freedom-search>=0.1.9
scrapemaster>=0.2.0
freedom_search
lollms_client>=0.7.5

aiofiles
python-multipart
zipfile36
zipfile36
4 changes: 1 addition & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ GitPython
ascii_colors>=0.1.4
beautifulsoup4
packaging

fastapi
uvicorn
python-multipart
python-socketio
python-socketio[client]
python-socketio[asyncio_client]

pydantic
selenium
tiktoken
tiktoken
20 changes: 12 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,36 @@

import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()
README_MD_FILE = "README.md"
REQUIREMENTS_TXT_FILE = "requirements.txt"
REQUIREMENTS_DEV_TXT_FILE = "requirements_dev.txt"

with open(README_MD_FILE, "r", encoding="utf-8") as fh:
long_description = fh.read()

def read_requirements(path: Union[str, Path]):
def read_requirements(path: Union[str, Path]) -> list:
with open(path, "r") as file:
return file.read().splitlines()
return [line.strip() for line in file.readlines()]

requirements = list(filter(None, read_requirements(REQUIREMENTS_TXT_FILE)))
requirements_dev = list(filter(None, read_requirements(REQUIREMENTS_DEV_TXT_FILE)))

requirements = read_requirements("requirements.txt")
requirements_dev = read_requirements("requirements_dev.txt")

setuptools.setup(
name="Lollms-webui",
version="5.0.2",
version="5.0.4",
author="Saifeddine ALOUI",
author_email="[email protected]",
description="A web ui for running chat models with different bindings. Supports multiple personalities and extensions.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ParisNeo/lollms-webui",
url="https://github.com/ba2512005/lollms-webui",
packages=setuptools.find_packages(),
install_requires=requirements,
extras_require={"dev": requirements_dev},
classifiers=[
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache 2.0 License",
"Operating System :: OS Independent",
],
Expand Down