Git Product home page Git Product logo

Comments (6)

danstarns avatar danstarns commented on August 23, 2024

I imagine this would help windows users too:

from taskmatrix.

danstarns avatar danstarns commented on August 23, 2024

Here are the two I have tried:

# Start with the official PyTorch image
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime

# Set the working directory
WORKDIR /app

# Install necessary packages
RUN apt-get update && apt-get install -y \
    ffmpeg \
    libsm6 \
    libxext6 \
    libfontconfig1 \
    libxrender1 \
    && rm -rf /var/lib/apt/lists/*

# Copy files to the working directory
COPY visual_chatgpt.py requirement.txt download.sh ./

# Create a new environment and install dependencies
RUN conda create -n visgpt python=3.8 && \
    echo "conda activate visgpt" >> ~/.bashrc && \
    /bin/bash -c "source ~/.bashrc" && \
    pip install --no-cache-dir -r requirement.txt && \
    bash download.sh && \
    conda clean --all --yes && \
    rm -rf /opt/conda/pkgs/*

# Set an environment variable for the OpenAI API key
ENV OPENAI_API_KEY=${OPENAI_API_KEY}

# Create a new directory for the generated images
RUN mkdir /app/image && chmod 777 /app/image

# Start the application
CMD ["bash", "-c", "python visual_chatgpt.py"]
FROM python:3.8-slim-buster

WORKDIR /app

COPY visual_chatgpt.py requirement.txt download.sh ./

RUN apt-get update && \
    apt-get install -y git && \
    pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirement.txt && \
    bash download.sh && \
    apt-get remove -y git && \
    apt-get autoremove -y && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV OPENAI_API_KEY=${OPENAI_API_KEY}

RUN mkdir /app/image && chmod 777 /app/image

CMD ["bash", "-c", "python visual_chatgpt.py"]

from taskmatrix.

andzejsp avatar andzejsp commented on August 23, 2024

do they work? why two docker files?

Also the download.sh should be optional because its like 40GB of download. better bind the folder and maybe let users copy models manually or link them or whatever.

Do these dockerfiles work on windows? i havent tried it.

from taskmatrix.

sinwoobang avatar sinwoobang commented on August 23, 2024

@andzejsp I think that @danstarns wanted to try both pip and conda environments. That's why he's provided two Dockerfiles.
Why don't you try it by yourself on Windows?

from taskmatrix.

sinwoobang avatar sinwoobang commented on August 23, 2024

Just to add my 2 cents, I am still testing it though. Tried resolving the OpenCV version issue #50.

FROM python:3.8-slim-buster

ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ENV PYTHONFAULTHANDLER=1 \
    PYTHONHASHSEED=random \
    PYTHONUNBUFFERED=1

RUN apt-get update -y
RUN apt-get install -y git curl wget

RUN git clone https://github.com/microsoft/visual-chatgpt.git

WORKDIR /visual-chatgpt/

RUN pip install --upgrade pip
RUN pip install opencv-python
RUN sed '/opencv/d' requirement.txt > requirement.txt
RUN pip install -r requirement.txt
RUN bash download.sh

RUN mkdir /visual-chatgpt/image && chmod 777 /visual-chatgpt/image

CMD ["bash", "-c", "python", "visual_chatgpt.py"]

from taskmatrix.

mosheliv avatar mosheliv commented on August 23, 2024

Anyone managed to run the newest version in docker?

from taskmatrix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.