local embeddings model, requirements cleanup
frdel committed
Jun 11, 2024 at 17:44 UTC
0bdb78f5a6b1edab3bc9269369f92805e5f08219
3 files changed
+9
-123
main.py
+2
-2
@@ -18,7 +18,8 @@ def chat():
18
# chat_llm = models.get_ollama_dolphin()
19
20
# embedding model used for memory
21
- embedding_llm = models.get_embedding_openai()
21
+ # embedding_llm = models.get_embedding_openai()
22
+ embedding_llm = models.get_embedding_hf()
23
24
# initial configuration
25
Agent.configure(
@@ -35,7 +36,6 @@ def chat():
36
while True:
37
# ask user for message
38
PrintStyle(background_color="#6C3483", font_color="white", bold=True, padding=True).print(f"User message ('exit' to leave):")
38
- # while input_lock: time.sleep(0.1)
39
with input_lock:
40
user_input = input("> ").strip()
41
PrintStyle(font_color="white", padding=False, log_only=True).print(f"> {user_input}")
models.py
+1
-1
@@ -4,7 +4,7 @@ from langchain_community.llms import Ollama
4
from langchain_openai import ChatOpenAI, OpenAI, OpenAIEmbeddings
5
from langchain_anthropic import ChatAnthropic
6
from langchain_groq import ChatGroq
7
-from langchain_community.embeddings import HuggingFaceEmbeddings
7
+from langchain_huggingface import HuggingFaceEmbeddings
8
9
10
# Load environment variables
requirements.txt
+6
-120
@@ -1,124 +1,10 @@
1
-aiohttp==3.9.5
2
-aiosignal==1.3.1
3
-annotated-types==0.7.0
1
ansio==0.0.1
5
-anthropic==0.28.0
6
-anyio==4.4.0
7
-asgiref==3.8.1
8
-attrs==23.2.0
9
-backoff==2.2.1
10
-bcrypt==4.1.3
11
-build==1.2.1
12
-cachetools==5.3.3
13
-certifi==2024.6.2
14
-charset-normalizer==3.3.2
15
-chroma-hnswlib==0.7.3
16
-chromadb==0.5.0
17
-click==8.1.7
18
-coloredlogs==15.0.1
19
-dataclasses-json==0.6.7
20
-defusedxml==0.7.1
21
-Deprecated==1.2.14
22
-distro==1.9.0
23
-dnspython==2.6.1
24
-email_validator==2.1.1
25
-fastapi==0.111.0
26
-fastapi-cli==0.0.4
27
-filelock==3.14.0
28
-flatbuffers==24.3.25
29
-frozenlist==1.4.1
30
-fsspec==2024.6.0
31
-google-auth==2.30.0
32
-googleapis-common-protos==1.63.1
33
-groq==0.8.0
34
-grpcio==1.64.1
35
-h11==0.14.0
36
-httpcore==1.0.5
37
-httptools==0.6.1
38
-httpx==0.27.0
39
-huggingface-hub==0.23.3
40
-humanfriendly==10.0
41
-idna==3.7
42
-importlib_metadata==7.1.0
43
-importlib_resources==6.4.0
44
-Jinja2==3.1.4
45
-jiter==0.4.1
46
-jsonpatch==1.33
47
-jsonpointer==2.4
48
-kubernetes==30.1.0
49
-langchain==0.2.3
50
-langchain-anthropic==0.1.15
51
-langchain-chroma==0.1.1
52
-langchain-community==0.2.4
53
-langchain-core==0.2.5
2
+python-dotenv==1.0.1
3
langchain-groq==0.1.5
4
+langchain-huggingface==0.0.3
5
langchain-openai==0.1.8
56
-langchain-text-splitters==0.2.1
57
-langsmith==0.1.75
58
-markdown-it-py==3.0.0
59
-MarkupSafe==2.1.5
60
-marshmallow==3.21.3
61
-mdurl==0.1.2
62
-mmh3==4.1.0
63
-monotonic==1.6
64
-mpmath==1.3.0
65
-multidict==6.0.5
66
-mypy-extensions==1.0.0
67
-numpy==1.26.4
68
-oauthlib==3.2.2
69
-onnxruntime==1.18.0
70
-openai==1.33.0
71
-opentelemetry-api==1.25.0
72
-opentelemetry-exporter-otlp-proto-common==1.25.0
73
-opentelemetry-exporter-otlp-proto-grpc==1.25.0
74
-opentelemetry-instrumentation==0.46b0
75
-opentelemetry-instrumentation-asgi==0.46b0
76
-opentelemetry-instrumentation-fastapi==0.46b0
77
-opentelemetry-proto==1.25.0
78
-opentelemetry-sdk==1.25.0
79
-opentelemetry-semantic-conventions==0.46b0
80
-opentelemetry-util-http==0.46b0
81
-orjson==3.10.3
82
-overrides==7.7.0
83
-packaging==23.2
84
-posthog==3.5.0
85
-protobuf==4.25.3
86
-pyasn1==0.6.0
87
-pyasn1_modules==0.4.0
88
-pydantic==2.7.3
89
-pydantic_core==2.18.4
90
-Pygments==2.18.0
91
-PyPika==0.48.9
92
-pyproject_hooks==1.1.0
93
-python-dateutil==2.9.0.post0
94
-python-dotenv==1.0.1
95
-python-multipart==0.0.9
96
-PyYAML==6.0.1
97
-regex==2024.5.15
98
-requests==2.32.3
99
-requests-oauthlib==2.0.0
100
-rich==13.7.1
101
-rsa==4.9
102
-shellingham==1.5.4
103
-six==1.16.0
104
-sniffio==1.3.1
105
-SQLAlchemy==2.0.30
106
-starlette==0.37.2
107
-sympy==1.12.1
108
-tenacity==8.3.0
109
-tiktoken==0.7.0
110
-tokenizers==0.19.1
111
-tqdm==4.66.4
112
-typer==0.12.3
113
-typing-inspect==0.9.0
114
-typing_extensions==4.12.2
115
-ujson==5.10.0
116
-urllib3==2.2.1
117
-uvicorn==0.30.1
118
-watchfiles==0.22.0
6
+langchain-community==0.2.4
7
+langchain-anthropic==0.1.15
8
+langchain-chroma==0.1.1
9
webcolors==24.6.0
120
-websocket-client==1.8.0
121
-websockets==12.0
122
-wrapt==1.16.0
123
-yarl==1.9.4
124
-zipp==3.19.2
10
+sentence-transformers==3.0.1
\ No newline at end of file