Spaces:
Sleeping
Sleeping
h3110Fr13nd
commited on
Commit
•
42990eb
1
Parent(s):
1383262
Requirements
Browse files- .gitignore +3 -0
- main.py +8 -4
- requirements.txt +139 -0
.gitignore
CHANGED
@@ -2,3 +2,6 @@ __pycache__
|
|
2 |
pragetx_chroma
|
3 |
*.ipynb
|
4 |
temp*
|
|
|
|
|
|
|
|
2 |
pragetx_chroma
|
3 |
*.ipynb
|
4 |
temp*
|
5 |
+
.env
|
6 |
+
.venv
|
7 |
+
venv
|
main.py
CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
|
|
2 |
import json
|
3 |
import os
|
4 |
import shutil
|
5 |
-
import magic
|
6 |
-
import ollama
|
7 |
from langchain_community.embeddings.sentence_transformer import SentenceTransformerEmbeddings
|
8 |
from langchain_community.vectorstores.qdrant import Qdrant
|
9 |
from langchain_core.runnables import RunnablePassthrough
|
@@ -22,8 +22,12 @@ dotenv.load_dotenv()
|
|
22 |
class GradioApp:
|
23 |
def __init__(self):
|
24 |
self.llm = ChatOllama(model="phi3:3.8b", base_url="http://localhost:11434", num_gpu=32)
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
self.chain = (self.llm | StrOutputParser())
|
28 |
|
29 |
def user(self,user_message, history):
|
|
|
2 |
import json
|
3 |
import os
|
4 |
import shutil
|
5 |
+
# import magic
|
6 |
+
# import ollama
|
7 |
from langchain_community.embeddings.sentence_transformer import SentenceTransformerEmbeddings
|
8 |
from langchain_community.vectorstores.qdrant import Qdrant
|
9 |
from langchain_core.runnables import RunnablePassthrough
|
|
|
22 |
class GradioApp:
|
23 |
def __init__(self):
|
24 |
self.llm = ChatOllama(model="phi3:3.8b", base_url="http://localhost:11434", num_gpu=32)
|
25 |
+
hf_email = os.getenv("HF_EMAIL")
|
26 |
+
hf_pass = os.getenv("HF_PASS")
|
27 |
+
sign = Login(hf_email, hf_pass)
|
28 |
+
cookies = sign.login()
|
29 |
+
sign.saveCookies()
|
30 |
+
self.llm = hugchat.ChatBot(cookies=cookies.get_dict())
|
31 |
self.chain = (self.llm | StrOutputParser())
|
32 |
|
33 |
def user(self,user_message, history):
|
requirements.txt
CHANGED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==23.2.1
|
2 |
+
aiohttp==3.9.5
|
3 |
+
aiosignal==1.3.1
|
4 |
+
altair==5.3.0
|
5 |
+
annotated-types==0.7.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.2.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 |
+
contourpy==1.2.1
|
20 |
+
cycler==0.12.1
|
21 |
+
dataclasses-json==0.6.6
|
22 |
+
Deprecated==1.2.14
|
23 |
+
dnspython==2.6.1
|
24 |
+
email_validator==2.1.1
|
25 |
+
fastapi==0.111.0
|
26 |
+
fastapi-cli==0.0.4
|
27 |
+
ffmpy==0.3.2
|
28 |
+
filelock==3.14.0
|
29 |
+
flatbuffers==24.3.25
|
30 |
+
fonttools==4.52.1
|
31 |
+
frozenlist==1.4.1
|
32 |
+
fsspec==2024.5.0
|
33 |
+
google-auth==2.29.0
|
34 |
+
googleapis-common-protos==1.63.0
|
35 |
+
gradio==4.31.5
|
36 |
+
gradio_client==0.16.4
|
37 |
+
greenlet==3.0.3
|
38 |
+
grpcio==1.64.0
|
39 |
+
h11==0.14.0
|
40 |
+
httpcore==1.0.5
|
41 |
+
httptools==0.6.1
|
42 |
+
httpx==0.27.0
|
43 |
+
hugchat==0.4.6
|
44 |
+
huggingface-hub==0.23.2
|
45 |
+
humanfriendly==10.0
|
46 |
+
idna==3.7
|
47 |
+
importlib-metadata==7.0.0
|
48 |
+
importlib_resources==6.4.0
|
49 |
+
Jinja2==3.1.4
|
50 |
+
jsonpatch==1.33
|
51 |
+
jsonpointer==2.4
|
52 |
+
jsonschema==4.22.0
|
53 |
+
jsonschema-specifications==2023.12.1
|
54 |
+
kiwisolver==1.4.5
|
55 |
+
kubernetes==29.0.0
|
56 |
+
langchain==0.2.1
|
57 |
+
langchain-chroma==0.1.1
|
58 |
+
langchain-community==0.2.1
|
59 |
+
langchain-core==0.2.1
|
60 |
+
langchain-text-splitters==0.2.0
|
61 |
+
langsmith==0.1.63
|
62 |
+
markdown-it-py==3.0.0
|
63 |
+
MarkupSafe==2.1.5
|
64 |
+
marshmallow==3.21.2
|
65 |
+
matplotlib==3.9.0
|
66 |
+
mdurl==0.1.2
|
67 |
+
mmh3==4.1.0
|
68 |
+
monotonic==1.6
|
69 |
+
mpmath==1.3.0
|
70 |
+
multidict==6.0.5
|
71 |
+
mypy-extensions==1.0.0
|
72 |
+
numpy==1.26.4
|
73 |
+
oauthlib==3.2.2
|
74 |
+
onnxruntime==1.18.0
|
75 |
+
opentelemetry-api==1.24.0
|
76 |
+
opentelemetry-exporter-otlp-proto-common==1.24.0
|
77 |
+
opentelemetry-exporter-otlp-proto-grpc==1.24.0
|
78 |
+
opentelemetry-instrumentation==0.45b0
|
79 |
+
opentelemetry-instrumentation-asgi==0.45b0
|
80 |
+
opentelemetry-instrumentation-fastapi==0.45b0
|
81 |
+
opentelemetry-proto==1.24.0
|
82 |
+
opentelemetry-sdk==1.24.0
|
83 |
+
opentelemetry-semantic-conventions==0.45b0
|
84 |
+
opentelemetry-util-http==0.45b0
|
85 |
+
orjson==3.10.3
|
86 |
+
overrides==7.7.0
|
87 |
+
packaging==23.2
|
88 |
+
pandas==2.2.2
|
89 |
+
pillow==10.3.0
|
90 |
+
posthog==3.5.0
|
91 |
+
protobuf==4.25.3
|
92 |
+
pyasn1==0.6.0
|
93 |
+
pyasn1_modules==0.4.0
|
94 |
+
pydantic==2.7.1
|
95 |
+
pydantic_core==2.18.2
|
96 |
+
pydub==0.25.1
|
97 |
+
Pygments==2.18.0
|
98 |
+
pyparsing==3.1.2
|
99 |
+
PyPika==0.48.9
|
100 |
+
pyproject_hooks==1.1.0
|
101 |
+
python-dateutil==2.9.0.post0
|
102 |
+
python-dotenv==1.0.1
|
103 |
+
python-multipart==0.0.9
|
104 |
+
pytz==2024.1
|
105 |
+
PyYAML==6.0.1
|
106 |
+
referencing==0.35.1
|
107 |
+
requests==2.32.2
|
108 |
+
requests-oauthlib==2.0.0
|
109 |
+
requests-toolbelt==1.0.0
|
110 |
+
rich==13.7.1
|
111 |
+
rpds-py==0.18.1
|
112 |
+
rsa==4.9
|
113 |
+
ruff==0.4.5
|
114 |
+
semantic-version==2.10.0
|
115 |
+
shellingham==1.5.4
|
116 |
+
six==1.16.0
|
117 |
+
sniffio==1.3.1
|
118 |
+
SQLAlchemy==2.0.30
|
119 |
+
starlette==0.37.2
|
120 |
+
sympy==1.12
|
121 |
+
tenacity==8.3.0
|
122 |
+
tokenizers==0.19.1
|
123 |
+
tomlkit==0.12.0
|
124 |
+
toolz==0.12.1
|
125 |
+
tqdm==4.66.4
|
126 |
+
typer==0.12.3
|
127 |
+
typing-inspect==0.9.0
|
128 |
+
typing_extensions==4.12.0
|
129 |
+
tzdata==2024.1
|
130 |
+
ujson==5.10.0
|
131 |
+
urllib3==2.2.1
|
132 |
+
uvicorn==0.29.0
|
133 |
+
uvloop==0.19.0
|
134 |
+
watchfiles==0.21.0
|
135 |
+
websocket-client==1.8.0
|
136 |
+
websockets==11.0.3
|
137 |
+
wrapt==1.16.0
|
138 |
+
yarl==1.9.4
|
139 |
+
zipp==3.19.0
|