Skip to content

Commit 0d1be4e

Browse files
committed
Refactor application structure and update dependencies
- Removed outdated files and reorganized the project structure for better maintainability. - Introduced a new launcher script (`run.py`) to facilitate running the application in web or CLI mode. - Updated `requirements.txt` to include core, data analysis, training, and testing dependencies. - Added new backend and frontend components to enhance functionality and user experience. - Implemented new schemas for requests and responses to standardize data handling. - Enhanced CSS styles for improved UI presentation. This commit lays the groundwork for future development and feature enhancements.
1 parent c6f5d06 commit 0d1be4e

29 files changed

+2008
-717
lines changed

requirements.txt

Lines changed: 21 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,21 @@
1-
aiohttp==3.9.5
2-
aiosignal==1.3.1
3-
altair==5.3.0
4-
annotated-types==0.7.0
5-
anyio==3.7.1
6-
async-timeout==4.0.3
7-
asyncio==3.4.3
8-
attrs==23.2.0
9-
black==24.4.2
10-
blinker==1.8.2
11-
cachetools==5.4.0
12-
certifi==2024.7.4
13-
charset-normalizer==3.3.2
14-
click==8.1.7
15-
dataclasses-json==0.6.7
16-
deta==1.2.0
17-
exceptiongroup==1.2.2
18-
filelock==3.15.4
19-
frozenlist==1.4.1
20-
fsspec==2024.6.1
21-
gitdb==4.0.11
22-
GitPython==3.1.43
23-
greenlet==3.0.3
24-
h11==0.14.0
25-
httpcore==0.17.3
26-
httpx==0.24.1
27-
httpx-oauth==0.13.0
28-
huggingface-hub==0.23.4
29-
idna==3.7
30-
importlib-metadata==6.11.0
31-
iniconfig==2.0.0
32-
Jinja2==3.1.5
33-
joblib==1.4.2
34-
jsonpatch==1.33
35-
jsonpointer==3.0.0
36-
jsonschema==4.23.0
37-
jsonschema-specifications==2023.12.1
38-
langchain==0.2.14
39-
langchain-core==0.2.32
40-
langchain-community>=0.0.37
41-
langchain-huggingface==0.0.3
42-
langchain-text-splitters==0.2.2
43-
langsmith==0.1.93
44-
markdown-it-py==3.0.0
45-
MarkupSafe==2.1.5
46-
marshmallow==3.21.3
47-
mdurl==0.1.2
48-
mpmath==1.3.0
49-
multidict==6.0.5
50-
mypy-extensions==1.0.0
51-
networkx==3.3
52-
numpy==1.26.4
53-
nvidia-cublas-cu12==12.1.3.1
54-
nvidia-cuda-cupti-cu12==12.1.105
55-
nvidia-cuda-nvrtc-cu12==12.1.105
56-
nvidia-cuda-runtime-cu12==12.1.105
57-
nvidia-cudnn-cu12==9.1.0.70
58-
nvidia-cufft-cu12==11.0.2.54
59-
nvidia-curand-cu12==10.3.2.106
60-
nvidia-cusolver-cu12==11.4.5.107
61-
nvidia-cusparse-cu12==12.1.0.106
62-
nvidia-nccl-cu12==2.20.5
63-
nvidia-nvjitlink-cu12==12.5.82
64-
nvidia-nvtx-cu12==12.1.105
65-
orjson==3.10.6
66-
packaging==23.2
67-
pandas==2.2.2
68-
pathspec==0.12.1
69-
pillow==10.4.0
70-
platformdirs==4.2.2
71-
pluggy==1.5.0
72-
protobuf==4.25.4
73-
pyarrow==17.0.0
74-
pydantic==2.8.2
75-
pydantic_core==2.20.1
76-
pydeck==0.9.1
77-
Pygments==2.18.0
78-
pytest==8.3.2
79-
python-dateutil==2.9.0.post0
80-
python-dotenv==1.0.0
81-
pytz==2024.1
82-
PyYAML==6.0.1
83-
referencing==0.35.1
84-
regex==2024.7.24
85-
requests==2.32.3
86-
rich==13.7.1
87-
rpds-py==0.19.1
88-
safetensors==0.4.3
89-
scikit-learn==1.5.1
90-
scipy==1.14.0
91-
sentence-transformers==3.0.1
92-
six==1.16.0
93-
smmap==5.0.1
94-
sniffio==1.3.1
95-
SQLAlchemy==2.0.31
96-
streamlit==1.36.0
97-
streamlit-oauth==0.1.5
98-
sympy==1.13.1
99-
tenacity==8.5.0
100-
threadpoolctl==3.5.0
101-
tokenizers==0.19.1
102-
toml==0.10.2
103-
tomli==2.0.1
104-
toolz==0.12.1
105-
torch==2.4.0
106-
tornado==6.4.2
107-
tqdm==4.66.4
108-
transformers==4.48.0
109-
triton==3.0.0
110-
typing-inspect==0.9.0
111-
typing_extensions==4.12.2
112-
tzdata==2024.1
113-
tzlocal==5.2
114-
urllib3==2.2.2
115-
validators==0.33.0
116-
watchdog==4.0.1
117-
yarl==1.9.4
118-
zipp==3.19.2
1+
# Core application dependencies
2+
streamlit>=1.36.0
3+
pydantic-ai-slim[groq]>=0.6.0
4+
pydantic>=2.0.0
5+
pydantic-settings>=2.0.0
6+
7+
# Data analysis dependencies
8+
pandas>=2.0.0
9+
numpy>=1.24.0
10+
matplotlib>=3.7.0
11+
seaborn>=0.12.0
12+
jupyter-client>=8.0.0
13+
14+
# Training dependencies (optional - only needed for model training)
15+
datasets>=2.14.0
16+
transformers>=4.48.0
17+
trl>=0.7.0
18+
peft>=0.6.0
19+
20+
# Testing dependencies (optional - only needed for running tests)
21+
pytest>=8.3.0

run.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Launcher script for Querypls application.
4+
"""
5+
6+
import sys
7+
import os
8+
import argparse
9+
10+
# Add src to path
11+
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
12+
13+
14+
def run_streamlit():
15+
"""Run the Streamlit application."""
16+
import subprocess
17+
import streamlit.web.cli as stcli
18+
19+
# Set environment variables
20+
os.environ['STREAMLIT_SERVER_PORT'] = '8501'
21+
os.environ['STREAMLIT_SERVER_ADDRESS'] = 'localhost'
22+
23+
# Run streamlit
24+
sys.argv = [
25+
'streamlit', 'run',
26+
'src/frontend/app.py',
27+
'--server.port=8501',
28+
'--server.address=localhost'
29+
]
30+
sys.exit(stcli.main())
31+
32+
33+
def run_cli():
34+
"""Run the CLI application."""
35+
from terminal.cli import main as cli_main
36+
cli_main()
37+
38+
39+
def main():
40+
"""Main launcher function."""
41+
parser = argparse.ArgumentParser(description='Querypls - SQL Generation Tool')
42+
parser.add_argument(
43+
'mode',
44+
choices=['web', 'cli'],
45+
default='web',
46+
nargs='?',
47+
help='Run mode: web (Streamlit) or cli (Command Line)'
48+
)
49+
parser.add_argument(
50+
'cli_args',
51+
nargs='*',
52+
help='Arguments to pass to CLI (when mode is cli)'
53+
)
54+
55+
args = parser.parse_args()
56+
57+
if args.mode == 'web':
58+
print("🚀 Starting Querypls Web Application...")
59+
run_streamlit()
60+
elif args.mode == 'cli':
61+
print("🚀 Starting Querypls CLI...")
62+
# Pass CLI arguments to the CLI
63+
if args.cli_args:
64+
sys.argv = ['cli'] + args.cli_args
65+
run_cli()
66+
67+
68+
if __name__ == "__main__":
69+
main()

src/app.py

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/auth.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)