Code Monkey home page Code Monkey logo

tiangong-ai-chat's Introduction

TianGong Chat Docker Publish

Env Preparing

Using VSCode Dev Contariners

Tutorial

Python 3 -> Additional Options -> 3.11-bullseye -> ZSH Plugins (Last One) -> Trust @devcontainers-contrib -> Keep Defaults

Setup venv:

python3.11 -m venv .venv
source .venv/bin/activate

Install requirements:

pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt --upgrade

pip freeze > requirements_freeze.txt
sudo apt install python3.11-dev

sudo apt -y install libmagic-dev
sudo apt -y install poppler-utils
sudo apt -y install tesseract-ocr
sudo apt -y install libreoffice
sudo apt -y install pandoc

Install Cuda (optional):

sudo apt install nvidia-cuda-toolkit

Env Preparing in MacOS

Install Python 3.11

brew update
brew install [email protected]

Setup venv:

python3.11 -m venv .venv
source .venv/bin/activate

Install requirements:

pip install --upgrade pip
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt --upgrade
brew update
brew install libmagic
brew install poppler-qt5
# echo 'export PATH="/usr/local/opt/poppler-qt5/bin:$PATH"' >> ~/.zshrc
# export LDFLAGS="-L/usr/local/opt/poppler-qt5/lib"
# export CPPFLAGS="-I/usr/local/opt/poppler-qt5/include"
brew install tesseract
# brew install tesseract-lang
# brew cleanup tesseract-lang
brew install libreoffice
brew install pandoc

Start

export ui=tiangong-en

streamlit run Chat.py

Auto Build

The auto build will be triggered by pushing any tag named like release-v$version. For instance, push a tag named as v0.0.1 will build a docker image of 0.0.1 version.

#list existing tags
git tag
#creat a new tag
git tag v0.0.1
#push this tag to origin
git push origin v0.0.1

sphinx

sphinx-apidoc --force -o sphinx/source/ src/
sphinx-autobuild sphinx/source docs/

Docker Manually Build

docker build -t linancn/tiangong-ai-chat:v0.0.1 .
docker push linancn/tiangong-ai-chat:v0.0.1

Production Run

docker network create tiangongbridge

docker run --detach \
    --name nginx-proxy \
    --restart=always \
    --publish 80:80 \
    --publish 443:443 \
    --volume certs:/etc/nginx/certs \
    --volume vhost:/etc/nginx/vhost.d \
    --volume html:/usr/share/nginx/html \
    --volume /var/run/docker.sock:/tmp/docker.sock:ro \
    --network=tiangongbridge \
    --network-alias=nginx-proxy \
    nginxproxy/nginx-proxy:latest

docker run --detach \
    --name nginx-proxy-acme \
    --restart=always \
    --volumes-from nginx-proxy \
    --volume /var/run/docker.sock:/var/run/docker.sock:ro \
    --volume acme:/etc/acme.sh \
    --network=tiangongbridge \
    --network-alias=nginx-proxy-acme \
    nginxproxy/acme-companion:latest

docker run --detach \
    --name tiangong-ai-chat \
    --restart=always \
    --expose 8501 \
    --net=tiangongbridge \
    --env ui=tiangong-en \
    --env VIRTUAL_HOST=YourURL \
    --env VIRTUAL_PORT=8501 \
    --env LETSENCRYPT_HOST=YourURL \
    --env LETSENCRYPT_EMAIL=YourEmail \
    linancn/tiangong-ai-chat:latest

docker cp .streamlit/secrets.toml tiangong-ai-chat:/app/.streamlit/secrets.toml

Nginx config

default file location: /etc/nginx/sites-enabled/default

sudo apt update
sudo apt install nginx
sudo nginx
sudo nginx -s reload
sudo nginx -s stop

To Do

DDG empty results bug

tiangong-ai-chat's People

Contributors

linancn avatar janecrystall avatar levenkiny avatar fadeloo avatar kaiwux avatar

Stargazers

 avatar  avatar Junyan Qin avatar  avatar PKQ1688 avatar Jerry Song avatar  avatar  avatar  avatar  avatar  avatar Jianchuan Qi avatar XIAOHAN DONG avatar  avatar

Watchers

 avatar

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.