Spaces:
Build error
Build error
Commit ·
ba1913e
1
Parent(s): 904ba04
modify knowledge
Browse files- Knowledge.py +3 -1
- requirements.txt +38 -0
Knowledge.py
CHANGED
|
@@ -51,6 +51,7 @@ def Chain(question, contents, api):
|
|
| 51 |
model = ChatGoogleGenerativeAI(
|
| 52 |
model='gemini-pro',
|
| 53 |
google_api_key = api,
|
|
|
|
| 54 |
safety_settings = {
|
| 55 |
genai.types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: genai.types.HarmBlockThreshold.BLOCK_ONLY_HIGH,
|
| 56 |
genai.types.HarmCategory.HARM_CATEGORY_HARASSMENT: genai.types.HarmBlockThreshold.BLOCK_ONLY_HIGH,
|
|
@@ -66,7 +67,8 @@ def Chain(question, contents, api):
|
|
| 66 |
)
|
| 67 |
while(True):
|
| 68 |
try:
|
| 69 |
-
|
|
|
|
| 70 |
except:
|
| 71 |
time.sleep(1)
|
| 72 |
|
|
|
|
| 51 |
model = ChatGoogleGenerativeAI(
|
| 52 |
model='gemini-pro',
|
| 53 |
google_api_key = api,
|
| 54 |
+
tempertature = 0.1,
|
| 55 |
safety_settings = {
|
| 56 |
genai.types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: genai.types.HarmBlockThreshold.BLOCK_ONLY_HIGH,
|
| 57 |
genai.types.HarmCategory.HARM_CATEGORY_HARASSMENT: genai.types.HarmBlockThreshold.BLOCK_ONLY_HIGH,
|
|
|
|
| 67 |
)
|
| 68 |
while(True):
|
| 69 |
try:
|
| 70 |
+
answer = chain.invoke(question)
|
| 71 |
+
return answer
|
| 72 |
except:
|
| 73 |
time.sleep(1)
|
| 74 |
|
requirements.txt
CHANGED
|
@@ -4,17 +4,25 @@ aiosignal==1.3.1
|
|
| 4 |
altair==5.3.0
|
| 5 |
annotated-types==0.7.0
|
| 6 |
anyio==4.4.0
|
|
|
|
| 7 |
async-timeout==4.0.3
|
| 8 |
attrs==23.2.0
|
|
|
|
|
|
|
|
|
|
| 9 |
cached-property==1.5.2
|
| 10 |
cachetools==5.3.3
|
| 11 |
certifi==2024.6.2
|
| 12 |
charset-normalizer==3.3.2
|
| 13 |
chevron==0.14.0
|
|
|
|
|
|
|
| 14 |
click==8.1.7
|
|
|
|
| 15 |
contourpy==1.2.1
|
| 16 |
cycler==0.12.1
|
| 17 |
dataclasses-json==0.6.6
|
|
|
|
| 18 |
dnspython==2.6.1
|
| 19 |
email_validator==2.1.1
|
| 20 |
exceptiongroup==1.2.1
|
|
@@ -22,6 +30,7 @@ fastapi==0.111.0
|
|
| 22 |
fastapi-cli==0.0.4
|
| 23 |
ffmpy==0.3.2
|
| 24 |
filelock==3.14.0
|
|
|
|
| 25 |
fonttools==4.53.0
|
| 26 |
frozendict==2.4.4
|
| 27 |
frozenlist==1.4.1
|
|
@@ -45,7 +54,9 @@ httplib2==0.22.0
|
|
| 45 |
httptools==0.6.1
|
| 46 |
httpx==0.27.0
|
| 47 |
huggingface-hub==0.23.3
|
|
|
|
| 48 |
idna==3.7
|
|
|
|
| 49 |
importlib_resources==6.4.0
|
| 50 |
Jinja2==3.1.4
|
| 51 |
jsonpatch==1.33
|
|
@@ -53,6 +64,7 @@ jsonpointer==2.4
|
|
| 53 |
jsonschema==4.22.0
|
| 54 |
jsonschema-specifications==2023.12.1
|
| 55 |
kiwisolver==1.4.5
|
|
|
|
| 56 |
langchain==0.2.2
|
| 57 |
langchain-community==0.2.3
|
| 58 |
langchain-core==0.2.4
|
|
@@ -64,13 +76,30 @@ MarkupSafe==2.1.5
|
|
| 64 |
marshmallow==3.21.3
|
| 65 |
matplotlib==3.9.0
|
| 66 |
mdurl==0.1.2
|
|
|
|
|
|
|
|
|
|
| 67 |
multidict==6.0.5
|
| 68 |
mypy-extensions==1.0.0
|
| 69 |
numpy==1.26.4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
orjson==3.10.3
|
|
|
|
| 71 |
packaging==23.2
|
| 72 |
pandas==2.2.2
|
| 73 |
pillow==10.3.0
|
|
|
|
| 74 |
proto-plus==1.23.0
|
| 75 |
protobuf==4.25.3
|
| 76 |
pyasn1==0.6.0
|
|
@@ -82,6 +111,8 @@ Pygments==2.18.0
|
|
| 82 |
PyMuPDF==1.24.5
|
| 83 |
PyMuPDFb==1.24.3
|
| 84 |
pyparsing==3.1.2
|
|
|
|
|
|
|
| 85 |
python-dateutil==2.9.0.post0
|
| 86 |
python-dotenv==1.0.1
|
| 87 |
python-multipart==0.0.9
|
|
@@ -89,6 +120,7 @@ pytz==2024.1
|
|
| 89 |
PyYAML==6.0.1
|
| 90 |
referencing==0.35.1
|
| 91 |
requests==2.32.3
|
|
|
|
| 92 |
rich==13.7.1
|
| 93 |
rpds-py==0.18.1
|
| 94 |
rsa==4.9
|
|
@@ -99,7 +131,10 @@ six==1.16.0
|
|
| 99 |
sniffio==1.3.1
|
| 100 |
SQLAlchemy==2.0.30
|
| 101 |
starlette==0.37.2
|
|
|
|
| 102 |
tenacity==8.3.0
|
|
|
|
|
|
|
| 103 |
tomlkit==0.12.0
|
| 104 |
toolz==0.12.1
|
| 105 |
tqdm==4.66.4
|
|
@@ -113,5 +148,8 @@ urllib3==2.2.1
|
|
| 113 |
uvicorn==0.30.1
|
| 114 |
uvloop==0.19.0
|
| 115 |
watchfiles==0.22.0
|
|
|
|
| 116 |
websockets==11.0.3
|
|
|
|
| 117 |
yarl==1.9.4
|
|
|
|
|
|
| 4 |
altair==5.3.0
|
| 5 |
annotated-types==0.7.0
|
| 6 |
anyio==4.4.0
|
| 7 |
+
asgiref==3.8.1
|
| 8 |
async-timeout==4.0.3
|
| 9 |
attrs==23.2.0
|
| 10 |
+
backoff==2.2.1
|
| 11 |
+
bcrypt==4.1.3
|
| 12 |
+
build==1.2.1
|
| 13 |
cached-property==1.5.2
|
| 14 |
cachetools==5.3.3
|
| 15 |
certifi==2024.6.2
|
| 16 |
charset-normalizer==3.3.2
|
| 17 |
chevron==0.14.0
|
| 18 |
+
chroma-hnswlib==0.7.3
|
| 19 |
+
chromadb==0.5.0
|
| 20 |
click==8.1.7
|
| 21 |
+
coloredlogs==15.0.1
|
| 22 |
contourpy==1.2.1
|
| 23 |
cycler==0.12.1
|
| 24 |
dataclasses-json==0.6.6
|
| 25 |
+
Deprecated==1.2.14
|
| 26 |
dnspython==2.6.1
|
| 27 |
email_validator==2.1.1
|
| 28 |
exceptiongroup==1.2.1
|
|
|
|
| 30 |
fastapi-cli==0.0.4
|
| 31 |
ffmpy==0.3.2
|
| 32 |
filelock==3.14.0
|
| 33 |
+
flatbuffers==24.3.25
|
| 34 |
fonttools==4.53.0
|
| 35 |
frozendict==2.4.4
|
| 36 |
frozenlist==1.4.1
|
|
|
|
| 54 |
httptools==0.6.1
|
| 55 |
httpx==0.27.0
|
| 56 |
huggingface-hub==0.23.3
|
| 57 |
+
humanfriendly==10.0
|
| 58 |
idna==3.7
|
| 59 |
+
importlib_metadata==7.1.0
|
| 60 |
importlib_resources==6.4.0
|
| 61 |
Jinja2==3.1.4
|
| 62 |
jsonpatch==1.33
|
|
|
|
| 64 |
jsonschema==4.22.0
|
| 65 |
jsonschema-specifications==2023.12.1
|
| 66 |
kiwisolver==1.4.5
|
| 67 |
+
kubernetes==29.0.0
|
| 68 |
langchain==0.2.2
|
| 69 |
langchain-community==0.2.3
|
| 70 |
langchain-core==0.2.4
|
|
|
|
| 76 |
marshmallow==3.21.3
|
| 77 |
matplotlib==3.9.0
|
| 78 |
mdurl==0.1.2
|
| 79 |
+
mmh3==4.1.0
|
| 80 |
+
monotonic==1.6
|
| 81 |
+
mpmath==1.3.0
|
| 82 |
multidict==6.0.5
|
| 83 |
mypy-extensions==1.0.0
|
| 84 |
numpy==1.26.4
|
| 85 |
+
oauthlib==3.2.2
|
| 86 |
+
onnxruntime==1.18.0
|
| 87 |
+
opentelemetry-api==1.25.0
|
| 88 |
+
opentelemetry-exporter-otlp-proto-common==1.25.0
|
| 89 |
+
opentelemetry-exporter-otlp-proto-grpc==1.25.0
|
| 90 |
+
opentelemetry-instrumentation==0.46b0
|
| 91 |
+
opentelemetry-instrumentation-asgi==0.46b0
|
| 92 |
+
opentelemetry-instrumentation-fastapi==0.46b0
|
| 93 |
+
opentelemetry-proto==1.25.0
|
| 94 |
+
opentelemetry-sdk==1.25.0
|
| 95 |
+
opentelemetry-semantic-conventions==0.46b0
|
| 96 |
+
opentelemetry-util-http==0.46b0
|
| 97 |
orjson==3.10.3
|
| 98 |
+
overrides==7.7.0
|
| 99 |
packaging==23.2
|
| 100 |
pandas==2.2.2
|
| 101 |
pillow==10.3.0
|
| 102 |
+
posthog==3.5.0
|
| 103 |
proto-plus==1.23.0
|
| 104 |
protobuf==4.25.3
|
| 105 |
pyasn1==0.6.0
|
|
|
|
| 111 |
PyMuPDF==1.24.5
|
| 112 |
PyMuPDFb==1.24.3
|
| 113 |
pyparsing==3.1.2
|
| 114 |
+
PyPika==0.48.9
|
| 115 |
+
pyproject_hooks==1.1.0
|
| 116 |
python-dateutil==2.9.0.post0
|
| 117 |
python-dotenv==1.0.1
|
| 118 |
python-multipart==0.0.9
|
|
|
|
| 120 |
PyYAML==6.0.1
|
| 121 |
referencing==0.35.1
|
| 122 |
requests==2.32.3
|
| 123 |
+
requests-oauthlib==2.0.0
|
| 124 |
rich==13.7.1
|
| 125 |
rpds-py==0.18.1
|
| 126 |
rsa==4.9
|
|
|
|
| 131 |
sniffio==1.3.1
|
| 132 |
SQLAlchemy==2.0.30
|
| 133 |
starlette==0.37.2
|
| 134 |
+
sympy==1.12.1
|
| 135 |
tenacity==8.3.0
|
| 136 |
+
tokenizers==0.19.1
|
| 137 |
+
tomli==2.0.1
|
| 138 |
tomlkit==0.12.0
|
| 139 |
toolz==0.12.1
|
| 140 |
tqdm==4.66.4
|
|
|
|
| 148 |
uvicorn==0.30.1
|
| 149 |
uvloop==0.19.0
|
| 150 |
watchfiles==0.22.0
|
| 151 |
+
websocket-client==1.8.0
|
| 152 |
websockets==11.0.3
|
| 153 |
+
wrapt==1.16.0
|
| 154 |
yarl==1.9.4
|
| 155 |
+
zipp==3.19.2
|