-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
31 changed files
with
12,945 additions
and
633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,146 @@ | ||
dynaconf | ||
fastapi | ||
jinja2 | ||
langchain==0.0.218 | ||
openai==0.27.4 | ||
pandas | ||
psycopg2-binary | ||
python-dotenv | ||
python-multipart | ||
sentence_transformers | ||
sqlalchemy | ||
sqlmodel | ||
tabulate | ||
tiktoken==0.3.2 | ||
typer | ||
uvicorn | ||
aiohttp==3.9.3 | ||
aiosignal==1.3.1 | ||
annotated-types==0.6.0 | ||
anyio==4.3.0 | ||
argon2-cffi==23.1.0 | ||
argon2-cffi-bindings==21.2.0 | ||
arrow==1.3.0 | ||
asttokens==2.4.1 | ||
async-lru==2.0.4 | ||
attrs==23.2.0 | ||
Automat==22.10.0 | ||
Babel==2.14.0 | ||
beautifulsoup4==4.12.3 | ||
bleach==6.1.0 | ||
certifi==2024.2.2 | ||
cffi==1.16.0 | ||
charset-normalizer==3.3.2 | ||
comm==0.2.2 | ||
constantly==23.10.4 | ||
cryptography==42.0.5 | ||
cssselect==1.2.0 | ||
dataclasses-json==0.6.4 | ||
debugpy==1.8.1 | ||
decorator==5.1.1 | ||
defusedxml==0.7.1 | ||
distro==1.9.0 | ||
executing==2.0.1 | ||
fastjsonschema==2.19.1 | ||
filelock==3.13.1 | ||
fqdn==1.5.1 | ||
frozenlist==1.4.1 | ||
greenlet==3.0.3 | ||
h11==0.14.0 | ||
httpcore==1.0.4 | ||
httpx==0.27.0 | ||
hyperlink==21.0.0 | ||
idna==3.6 | ||
incremental==22.10.0 | ||
iniconfig==2.0.0 | ||
ipykernel==6.29.3 | ||
ipython==8.22.2 | ||
isoduration==20.11.0 | ||
itemadapter==0.8.0 | ||
itemloaders==1.1.0 | ||
jedi==0.19.1 | ||
Jinja2==3.1.3 | ||
jmespath==1.0.1 | ||
json5==0.9.22 | ||
jsonpatch==1.33 | ||
jsonpointer==2.4 | ||
jsonschema==4.21.1 | ||
jsonschema-specifications==2023.12.1 | ||
jupyter-events==0.9.1 | ||
jupyter-lsp==2.2.4 | ||
jupyter_client==8.6.1 | ||
jupyter_core==5.7.2 | ||
jupyter_server==2.13.0 | ||
jupyter_server_terminals==0.5.3 | ||
jupyterlab==4.1.5 | ||
jupyterlab_pygments==0.3.0 | ||
jupyterlab_server==2.25.4 | ||
langchain==0.1.12 | ||
langchain-community==0.0.28 | ||
langchain-core==0.1.32 | ||
langchain-openai==0.0.8 | ||
langchain-text-splitters==0.0.1 | ||
langsmith==0.1.26 | ||
lxml==5.1.0 | ||
MarkupSafe==2.1.5 | ||
marshmallow==3.21.1 | ||
matplotlib-inline==0.1.6 | ||
mistune==3.0.2 | ||
multidict==6.0.5 | ||
mypy-extensions==1.0.0 | ||
nbclient==0.10.0 | ||
nbconvert==7.16.2 | ||
nbformat==5.10.3 | ||
nest-asyncio==1.6.0 | ||
notebook_shim==0.2.4 | ||
numpy==1.26.4 | ||
openai==1.14.0 | ||
orjson==3.9.15 | ||
overrides==7.7.0 | ||
packaging==23.2 | ||
pandocfilters==1.5.1 | ||
parsel==1.9.0 | ||
parso==0.8.3 | ||
pexpect==4.9.0 | ||
platformdirs==4.2.0 | ||
pluggy==1.4.0 | ||
prometheus_client==0.20.0 | ||
prompt-toolkit==3.0.43 | ||
Protego==0.3.0 | ||
psutil==5.9.8 | ||
ptyprocess==0.7.0 | ||
pure-eval==0.2.2 | ||
pyasn1==0.5.1 | ||
pyasn1-modules==0.3.0 | ||
pycparser==2.21 | ||
pydantic==2.6.4 | ||
pydantic_core==2.16.3 | ||
PyDispatcher==2.0.7 | ||
Pygments==2.17.2 | ||
pyOpenSSL==24.1.0 | ||
pytest==8.1.1 | ||
python-dateutil==2.9.0.post0 | ||
python-json-logger==2.0.7 | ||
PyYAML==6.0.1 | ||
pyzmq==25.1.2 | ||
queuelib==1.6.2 | ||
referencing==0.33.0 | ||
regex==2023.12.25 | ||
requests==2.31.0 | ||
requests-file==2.0.0 | ||
rfc3339-validator==0.1.4 | ||
rfc3986-validator==0.1.1 | ||
rpds-py==0.18.0 | ||
Scrapy==2.11.1 | ||
Send2Trash==1.8.2 | ||
service-identity==24.1.0 | ||
six==1.16.0 | ||
sniffio==1.3.1 | ||
soupsieve==2.5 | ||
SQLAlchemy==2.0.28 | ||
stack-data==0.6.3 | ||
tenacity==8.2.3 | ||
terminado==0.18.1 | ||
tiktoken==0.6.0 | ||
tinycss2==1.2.1 | ||
tldextract==5.1.1 | ||
tornado==6.4 | ||
tqdm==4.66.2 | ||
traitlets==5.14.2 | ||
Twisted==24.3.0 | ||
types-python-dateutil==2.9.0.20240315 | ||
typing-inspect==0.9.0 | ||
typing_extensions==4.10.0 | ||
uri-template==1.3.0 | ||
urllib3==2.2.1 | ||
w3lib==2.1.2 | ||
wcwidth==0.2.13 | ||
webcolors==1.13 | ||
webencodings==0.5.1 | ||
websocket-client==1.7.0 | ||
yarl==1.9.4 | ||
zope.interface==6.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from src.wrapper.lanbot import Langbot | ||
|
||
|
||
def test_basic(): | ||
assert Langbot('hi', lambda x: print(x), ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pandas as pd | ||
|
||
from config import POSTGRES_ENGINE | ||
from sentence_transformers import SentenceTransformer | ||
|
||
def embedding(dataframe, column): | ||
""" | ||
Creates embeddings for text in the passed column | ||
""" | ||
model = SentenceTransformer('multi-qa-MiniLM-L6-cos-v1') | ||
|
||
model_embeddings = model.encode(dataframe[column].to_list()) | ||
dataframe['embedding'] = model_embeddings.tolist() | ||
|
||
return dataframe | ||
|
||
|
||
def create_table(): | ||
POSTGRES_ENGINE.execute("CREATE TABLE IF NOT EXISTS datausa_tables.cubes (table_name text, table_description text, embedding vector(384))") | ||
return | ||
|
||
|
||
def load_data_to_db(df): | ||
|
||
print(df.head()) | ||
|
||
df_embeddings = embedding(df, 'table_description') | ||
df_embeddings.to_sql('cubes', con=POSTGRES_ENGINE, if_exists='append', index=False, schema='datausa_tables') | ||
|
||
return | ||
|
||
|
||
df = pd.DataFrame() | ||
|
||
df["table_name"] = ["Data_USA_House_election"] | ||
df['table_description'] = ["Table 'Data_USA_House_election' contains House election data, including number of votes by candidate, party and state."] | ||
|
||
create_table() | ||
|
||
load_data_to_db(df) |
Oops, something went wrong.