diff --git a/README.md b/README.md index 7bc71a23b..303aa41d2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # DB-GPT A Open Database-GPT Experiment + ![GitHub Repo stars](https://img.shields.io/github/stars/csunny/db-gpt?style=social) diff --git a/environment.yml b/environment.yml new file mode 100644 index 000000000..81872a557 --- /dev/null +++ b/environment.yml @@ -0,0 +1,62 @@ +name: db-pgt +channels: + - pytorch + - defaults + - anaconda +dependencies: + - python=3.9 + - cudatoolkit + - pip + - pytorch=1.12.1 + - pytorch-mutex=1.0=cuda + - torchaudio=0.12.1 + - torchvision=0.13.1 + - pip: + - accelerate==0.16.0 + - aiohttp==3.8.4 + - aiosignal==1.3.1 + - async-timeout==4.0.2 + - attrs==22.2.0 + - bitsandbytes==0.37.0 + - cchardet==2.1.7 + - chardet==5.1.0 + - contourpy==1.0.7 + - cycler==0.11.0 + - filelock==3.9.0 + - fonttools==4.38.0 + - frozenlist==1.3.3 + - huggingface-hub==0.13.4 + - importlib-resources==5.12.0 + - kiwisolver==1.4.4 + - matplotlib==3.7.0 + - multidict==6.0.4 + - openai==0.27.0 + - packaging==23.0 + - psutil==5.9.4 + - pycocotools==2.0.6 + - pyparsing==3.0.9 + - python-dateutil==2.8.2 + - pyyaml==6.0 + - regex==2022.10.31 + - tokenizers==0.13.2 + - tqdm==4.64.1 + - transformers==4.28.0 + - timm==0.6.13 + - spacy==3.5.1 + - webdataset==0.2.48 + - scikit-learn==1.2.2 + - scipy==1.10.1 + - yarl==1.8.2 + - zipp==3.14.0 + - omegaconf==2.3.0 + - opencv-python==4.7.0.72 + - iopath==0.1.10 + - tenacity==8.2.2 + - peft + - pycocoevalcap + - sentence-transformers + - umap-learn + - notebook + - gradio==3.24.1 + - gradio-client==0.0.8 + - wandb diff --git a/pilot/server/sqlgpt.py b/pilot/server/sqlgpt.py index 5bf2244cc..a74e99ad3 100644 --- a/pilot/server/sqlgpt.py +++ b/pilot/server/sqlgpt.py @@ -1,8 +1,10 @@ #!/usr/bin/env python3 #-*- coding: utf-8 -*- + import json import torch +import gradio as gr from fastchat.serve.inference import generate_stream, compress_module @@ -35,9 +37,17 @@ def generate(prompt): yield output if __name__ == "__main__": - pass - - + with gr.Blocks() as demo: + gr.Markdown("数据库SQL生成助手") + with gr.Tab("SQL生成"): + text_input = gr.TextArea() + text_output = gr.TextArea() + text_button = gr.Button("提交") + + + text_button.click(generate, input=text_input, output=text_output) + + demo.queue(concurrency_count=3).launch() diff --git a/requirements.txt b/requirements.txt index 44e89c0b9..dd7bf5189 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,51 @@ accelerate==0.16.0 torch==2.0.0 torchvision==0.13.1 torchaudio==0.12.1 +accelerate==0.16.0 +aiohttp==3.8.4 +aiosignal==1.3.1 +async-timeout==4.0.2 +attrs==22.2.0 +bitsandbytes==0.37.0 +cchardet==2.1.7 +chardet==5.1.0 +contourpy==1.0.7 +cycler==0.11.0 +filelock==3.9.0 +fonttools==4.38.0 +frozenlist==1.3.3 +huggingface-hub==0.13.4 +importlib-resources==5.12.0 +kiwisolver==1.4.4 +matplotlib==3.7.0 +multidict==6.0.4 +openai==0.27.0 +packaging==23.0 +psutil==5.9.4 +pycocotools==2.0.6 +pyparsing==3.0.9 +python-dateutil==2.8.2 +pyyaml==6.0 +regex==2022.10.31 +tokenizers==0.13.2 +tqdm==4.64.1 +transformers==4.28.0 +timm==0.6.13 +spacy==3.5.1 +webdataset==0.2.48 +scikit-learn==1.2.2 +scipy==1.10.1 +yarl==1.8.2 +zipp==3.14.0 +omegaconf==2.3.0 +opencv-python==4.7.0.72 +iopath==0.1.10 +tenacity==8.2.2 +peft +pycocoevalcap +sentence-transformers +umap-learn +notebook +gradio==3.24.1 +gradio-client==0.0.8 +wandb \ No newline at end of file