Spaces:
Build error
Build error
Upload folder using huggingface_hub
Browse files- configs/__pycache__/config.cpython-311.pyc +0 -0
- configs/config.py +1 -1
- requirements.txt +413 -222
- services/__pycache__/ui_service.cpython-311.pyc +0 -0
- services/ui_service.py +19 -16
configs/__pycache__/config.cpython-311.pyc
CHANGED
|
Binary files a/configs/__pycache__/config.cpython-311.pyc and b/configs/__pycache__/config.cpython-311.pyc differ
|
|
|
configs/config.py
CHANGED
|
@@ -6,7 +6,7 @@ from dotenv import load_dotenv
|
|
| 6 |
# Load environment variables from .env file.
|
| 7 |
load_dotenv()
|
| 8 |
|
| 9 |
-
|
| 10 |
|
| 11 |
# LLM Model Settings
|
| 12 |
GPT4O_MODEL = "gpt-4o"
|
|
|
|
| 6 |
# Load environment variables from .env file.
|
| 7 |
load_dotenv()
|
| 8 |
|
| 9 |
+
claude_client = anthropic.Anthropic()
|
| 10 |
|
| 11 |
# LLM Model Settings
|
| 12 |
GPT4O_MODEL = "gpt-4o"
|
requirements.txt
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
-
absl-py
|
| 2 |
-
accelerate
|
| 3 |
-
aiofiles
|
| 4 |
aiohappyeyeballs
|
| 5 |
-
aiohttp
|
| 6 |
-
aiohttp-retry
|
| 7 |
aiosignal
|
| 8 |
-
altair
|
| 9 |
annotated-types
|
| 10 |
ansi2html
|
| 11 |
-
anthropic
|
| 12 |
-
anyascii
|
| 13 |
anyio
|
| 14 |
-
appdirs
|
| 15 |
appnope
|
| 16 |
argon2-cffi
|
| 17 |
argon2-cffi-bindings
|
|
@@ -20,136 +20,134 @@ asgiref
|
|
| 20 |
asttokens
|
| 21 |
async-lru
|
| 22 |
attrs
|
| 23 |
-
audioread
|
| 24 |
babel
|
| 25 |
backoff
|
| 26 |
-
bangla
|
| 27 |
bcrypt
|
| 28 |
-
beautifulsoup4
|
| 29 |
-
bitsandbytes
|
| 30 |
bleach
|
| 31 |
blinker
|
| 32 |
-
blis
|
| 33 |
-
bnnumerizer
|
| 34 |
-
bnunicodenormalizer
|
| 35 |
Brotli
|
| 36 |
build
|
| 37 |
cached-property
|
| 38 |
cachetools
|
| 39 |
-
catalogue
|
| 40 |
certifi
|
| 41 |
cffi
|
| 42 |
-
charset-normalizer
|
| 43 |
chroma-hnswlib
|
| 44 |
chromadb
|
| 45 |
-
chromedriver-autoinstaller
|
| 46 |
click
|
| 47 |
clickhouse-connect
|
| 48 |
-
cloudpathlib
|
| 49 |
colorama
|
| 50 |
coloredlogs
|
| 51 |
comm
|
| 52 |
-
confection
|
| 53 |
contourpy
|
| 54 |
-
coqpit
|
| 55 |
cryptography
|
| 56 |
cycler
|
| 57 |
-
cymem
|
| 58 |
-
Cython
|
| 59 |
dash
|
| 60 |
-
dataclasses-json
|
| 61 |
-
datasets
|
| 62 |
-
dateparser
|
| 63 |
debugpy
|
| 64 |
decorator
|
| 65 |
-
deepseek
|
| 66 |
defusedxml
|
| 67 |
Deprecated
|
| 68 |
-
dill
|
| 69 |
-
distro
|
| 70 |
dnspython
|
| 71 |
-
docker-pycreds
|
| 72 |
-
docopt
|
| 73 |
duckdb
|
| 74 |
durationpy
|
| 75 |
-
einops
|
| 76 |
email_validator
|
| 77 |
-
encodec
|
| 78 |
entrypoints
|
| 79 |
exceptiongroup
|
| 80 |
executing
|
| 81 |
-
# faiss==1.9.0
|
| 82 |
-
# faiss-cpu==1.10.0
|
| 83 |
fastapi
|
| 84 |
fastapi-cli
|
| 85 |
fastjsonschema
|
| 86 |
-
feedparser
|
| 87 |
ffmpy
|
| 88 |
filelock
|
| 89 |
-
Flask
|
| 90 |
flatbuffers
|
| 91 |
fonttools
|
| 92 |
fqdn
|
| 93 |
frozenlist
|
| 94 |
-
fsspec
|
| 95 |
-
g2pkk
|
| 96 |
-
gensim
|
| 97 |
-
gitdb
|
| 98 |
-
GitPython
|
| 99 |
gmpy2
|
| 100 |
-
google-ai-generativelanguage
|
| 101 |
-
google-api-core
|
| 102 |
-
google-api-python-client
|
| 103 |
google-auth
|
| 104 |
-
google-auth-httplib2
|
| 105 |
-
google-generativeai
|
| 106 |
googleapis-common-protos
|
| 107 |
-
gradio
|
| 108 |
-
gradio_client
|
| 109 |
-
groovy
|
| 110 |
-
groq
|
| 111 |
-
grpcio
|
| 112 |
-
grpcio-status
|
| 113 |
-
grpclib
|
| 114 |
-
gruut
|
| 115 |
-
gruut-ipa
|
| 116 |
-
gruut_lang_de
|
| 117 |
-
gruut_lang_en
|
| 118 |
-
gruut_lang_es
|
| 119 |
-
gruut_lang_fr
|
| 120 |
-
gTTS
|
| 121 |
h11
|
| 122 |
h2
|
| 123 |
-
hangul-romanize
|
| 124 |
hnswlib
|
| 125 |
hpack
|
| 126 |
httpcore
|
| 127 |
-
httplib2
|
| 128 |
httptools
|
| 129 |
-
httpx
|
| 130 |
-
httpx-sse
|
| 131 |
-
huggingface-hub
|
| 132 |
humanfriendly
|
| 133 |
hyperframe
|
| 134 |
idna
|
| 135 |
importlib_metadata
|
| 136 |
importlib_resources
|
| 137 |
-
inflect
|
| 138 |
ipykernel
|
| 139 |
ipython
|
| 140 |
ipywidgets
|
| 141 |
isoduration
|
| 142 |
itsdangerous
|
| 143 |
-
jamo
|
| 144 |
jedi
|
| 145 |
-
jieba
|
| 146 |
Jinja2
|
| 147 |
-
jiter
|
| 148 |
-
jiwer
|
| 149 |
joblib
|
| 150 |
json5
|
| 151 |
-
jsonlines
|
| 152 |
-
jsonpatch
|
| 153 |
jsonpointer
|
| 154 |
jsonschema
|
| 155 |
jsonschema-specifications
|
|
@@ -166,190 +164,383 @@ jupyterlab_server
|
|
| 166 |
jupyterlab_widgets
|
| 167 |
kiwisolver
|
| 168 |
kubernetes
|
| 169 |
-
langchain
|
| 170 |
-
langchain-chroma
|
| 171 |
-
langchain-community
|
| 172 |
-
langchain-core
|
| 173 |
-
langchain-openai
|
| 174 |
-
langchain-text-splitters
|
| 175 |
-
langchainplus-sdk
|
| 176 |
-
langcodes
|
| 177 |
-
langsmith
|
| 178 |
-
language_data
|
| 179 |
-
lazy_loader
|
| 180 |
-
librosa
|
| 181 |
-
linkify-it-py
|
| 182 |
-
llvmlite
|
| 183 |
lz4
|
| 184 |
-
marisa-trie
|
| 185 |
-
Markdown
|
| 186 |
-
markdown-it-py
|
| 187 |
MarkupSafe
|
| 188 |
-
marshmallow
|
| 189 |
-
matplotlib
|
| 190 |
matplotlib-inline
|
| 191 |
-
mdit-py-plugins
|
| 192 |
mdurl
|
| 193 |
mistune
|
| 194 |
mmh3
|
| 195 |
-
modal
|
| 196 |
monotonic
|
| 197 |
-
more-itertools
|
| 198 |
mpmath
|
| 199 |
-
msgpack
|
| 200 |
multidict
|
| 201 |
-
multiprocess
|
| 202 |
-
munkres
|
| 203 |
-
murmurhash
|
| 204 |
-
mypy-extensions
|
| 205 |
-
narwhals
|
| 206 |
nbclient
|
| 207 |
nbconvert
|
| 208 |
nbformat
|
| 209 |
nest_asyncio
|
| 210 |
-
networkx
|
| 211 |
-
nltk
|
| 212 |
notebook_shim
|
| 213 |
-
num2words
|
| 214 |
-
numba
|
| 215 |
-
numexpr
|
| 216 |
numpy
|
| 217 |
oauthlib
|
| 218 |
-
ollama
|
| 219 |
onnxruntime
|
| 220 |
-
openai
|
| 221 |
-
openai-whisper
|
| 222 |
-
openapi-schema-pydantic
|
| 223 |
-
opentelemetry-api
|
| 224 |
-
opentelemetry-exporter-otlp-proto-common
|
| 225 |
-
opentelemetry-exporter-otlp-proto-grpc
|
| 226 |
-
opentelemetry-instrumentation
|
| 227 |
-
opentelemetry-instrumentation-asgi
|
| 228 |
-
opentelemetry-instrumentation-fastapi
|
| 229 |
-
opentelemetry-proto
|
| 230 |
-
opentelemetry-sdk
|
| 231 |
-
opentelemetry-semantic-conventions
|
| 232 |
-
opentelemetry-util-http
|
| 233 |
-
orjson
|
| 234 |
-
outcome
|
| 235 |
overrides
|
| 236 |
-
packaging
|
| 237 |
-
pandas
|
| 238 |
pandocfilters
|
| 239 |
parso
|
| 240 |
-
pathtools
|
| 241 |
-
peft
|
| 242 |
pexpect
|
| 243 |
pickleshare
|
| 244 |
pillow
|
| 245 |
pkgutil_resolve_name
|
| 246 |
platformdirs
|
| 247 |
-
plotly
|
| 248 |
-
pooch
|
| 249 |
posthog
|
| 250 |
-
preshed
|
| 251 |
prometheus_client
|
| 252 |
prompt_toolkit
|
| 253 |
propcache
|
| 254 |
-
proto-plus
|
| 255 |
-
protobuf
|
| 256 |
-
psutil
|
| 257 |
ptyprocess
|
| 258 |
pulsar-client
|
| 259 |
pure_eval
|
| 260 |
-
pyarrow
|
| 261 |
pyasn1
|
| 262 |
pyasn1_modules
|
| 263 |
pycparser
|
| 264 |
-
pydantic
|
| 265 |
-
pydantic-settings
|
| 266 |
pydantic_core
|
| 267 |
pydub
|
| 268 |
-
pygame
|
| 269 |
Pygments
|
| 270 |
PyJWT
|
| 271 |
-
pynndescent
|
| 272 |
-
pyobjc
|
| 273 |
-
pyobjc-core
|
| 274 |
-
pyobjc-framework-Accessibility
|
| 275 |
-
pyobjc-framework-Accounts
|
| 276 |
-
pyobjc-framework-AddressBook
|
| 277 |
-
pyobjc-framework-AdServices
|
| 278 |
-
pyobjc-framework-AdSupport
|
| 279 |
-
pyobjc-framework-AppleScriptKit
|
| 280 |
-
pyobjc-framework-AppleScriptObjC
|
| 281 |
-
pyobjc-framework-ApplicationServices
|
| 282 |
-
pyobjc-framework-AppTrackingTransparency
|
| 283 |
-
pyobjc-framework-AudioVideoBridging
|
| 284 |
-
pyobjc-framework-AuthenticationServices
|
| 285 |
-
pyobjc-framework-AutomaticAssessmentConfiguration
|
| 286 |
-
pyobjc-framework-Automator
|
| 287 |
-
pyobjc-framework-AVFoundation
|
| 288 |
-
pyobjc-framework-AVKit
|
| 289 |
-
pyobjc-framework-AVRouting
|
| 290 |
-
pyobjc-framework-BackgroundAssets
|
| 291 |
-
pyobjc-framework-BrowserEngineKit
|
| 292 |
-
pyobjc-framework-BusinessChat
|
| 293 |
-
pyobjc-framework-CoreAudio
|
| 294 |
-
pyobjc-framework-CoreAudioKit
|
| 295 |
-
pyobjc-framework-CoreBluetooth
|
| 296 |
-
pyobjc-framework-CoreData
|
| 297 |
-
pyobjc-framework-CoreHaptics
|
| 298 |
-
pyobjc-framework-CoreLocation
|
| 299 |
-
pyobjc-framework-CoreMedia
|
| 300 |
-
pyobjc-framework-CoreMediaIO
|
| 301 |
-
pyobjc-framework-CoreMIDI
|
| 302 |
-
pyobjc-framework-CoreML
|
| 303 |
-
pyobjc-framework-CoreMotion
|
| 304 |
-
pyobjc-framework-CoreServices
|
| 305 |
-
pyobjc-framework-CoreSpotlight
|
| 306 |
-
pyobjc-framework-CoreText
|
| 307 |
-
pyobjc-framework-CoreWLAN
|
| 308 |
-
pyobjc-framework-CryptoTokenKit
|
| 309 |
-
pyobjc-framework-DataDetection
|
| 310 |
-
pyobjc-framework-DeviceCheck
|
| 311 |
-
pyobjc-framework-DeviceDiscoveryExtension
|
| 312 |
-
pyobjc-framework-DictionaryServices
|
| 313 |
-
pyobjc-framework-DiscRecording
|
| 314 |
-
pyobjc-framework-DiscRecordingUI
|
| 315 |
-
pyobjc-framework-EventKit
|
| 316 |
-
pyobjc-framework-ExceptionHandling
|
| 317 |
-
pyobjc-framework-ExecutionPolicy
|
| 318 |
-
pyobjc-framework-ExtensionKit
|
| 319 |
-
pyobjc-framework-ExternalAccessory
|
| 320 |
-
pyobjc-framework-FileProvider
|
| 321 |
-
pyobjc-framework-FileProviderUI
|
| 322 |
-
pyobjc-framework-FinderSync
|
| 323 |
-
pyobjc-framework-FSEvents
|
| 324 |
-
pyobjc-framework-GameCenter
|
| 325 |
-
pyobjc-framework-GameController
|
| 326 |
-
pyobjc-framework-GameKit
|
| 327 |
-
pyobjc-framework-GameplayKit
|
| 328 |
-
pyobjc-framework-HealthKit
|
| 329 |
-
pyobjc-framework-ImageCaptureCore
|
| 330 |
-
pyobjc-framework-InputMethodKit
|
| 331 |
-
pyobjc-framework-InstallerPlugins
|
| 332 |
-
pyobjc-framework-InstantMessage
|
| 333 |
-
pyobjc-framework-Intents
|
| 334 |
-
pyobjc-framework-IntentsUI
|
| 335 |
-
pyobjc-framework-IOBluetooth
|
| 336 |
-
pyobjc-framework-
|
| 337 |
-
pyobjc-framework-
|
| 338 |
-
pyobjc-framework-
|
| 339 |
-
pyobjc-framework-
|
| 340 |
-
pyobjc-framework-
|
| 341 |
-
pyobjc-framework-
|
| 342 |
-
pyobjc-framework-
|
| 343 |
-
pyobjc-framework-
|
| 344 |
-
pyobjc-framework-
|
| 345 |
-
pyobjc-framework-
|
| 346 |
-
pyobjc-framework-
|
| 347 |
-
pyobjc-framework-
|
| 348 |
-
pyobjc-framework-
|
| 349 |
-
pyobjc-framework-
|
| 350 |
-
pyobjc-framework-
|
| 351 |
-
pyobjc-framework-
|
| 352 |
-
pyobjc-framework-
|
| 353 |
-
pyobjc-framework-
|
| 354 |
-
pyobjc-framework-
|
| 355 |
-
pyobjc-framework-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
absl-py
|
| 2 |
+
accelerate
|
| 3 |
+
aiofiles
|
| 4 |
aiohappyeyeballs
|
| 5 |
+
aiohttp
|
| 6 |
+
aiohttp-retry
|
| 7 |
aiosignal
|
| 8 |
+
altair
|
| 9 |
annotated-types
|
| 10 |
ansi2html
|
| 11 |
+
anthropic
|
| 12 |
+
anyascii
|
| 13 |
anyio
|
| 14 |
+
appdirs
|
| 15 |
appnope
|
| 16 |
argon2-cffi
|
| 17 |
argon2-cffi-bindings
|
|
|
|
| 20 |
asttokens
|
| 21 |
async-lru
|
| 22 |
attrs
|
| 23 |
+
audioread
|
| 24 |
babel
|
| 25 |
backoff
|
| 26 |
+
bangla
|
| 27 |
bcrypt
|
| 28 |
+
beautifulsoup4
|
| 29 |
+
bitsandbytes
|
| 30 |
bleach
|
| 31 |
blinker
|
| 32 |
+
blis
|
| 33 |
+
bnnumerizer
|
| 34 |
+
bnunicodenormalizer
|
| 35 |
Brotli
|
| 36 |
build
|
| 37 |
cached-property
|
| 38 |
cachetools
|
| 39 |
+
catalogue
|
| 40 |
certifi
|
| 41 |
cffi
|
| 42 |
+
charset-normalizer
|
| 43 |
chroma-hnswlib
|
| 44 |
chromadb
|
| 45 |
+
chromedriver-autoinstaller
|
| 46 |
click
|
| 47 |
clickhouse-connect
|
| 48 |
+
cloudpathlib
|
| 49 |
colorama
|
| 50 |
coloredlogs
|
| 51 |
comm
|
| 52 |
+
confection
|
| 53 |
contourpy
|
| 54 |
+
coqpit
|
| 55 |
cryptography
|
| 56 |
cycler
|
| 57 |
+
cymem
|
| 58 |
+
Cython
|
| 59 |
dash
|
| 60 |
+
dataclasses-json
|
| 61 |
+
datasets
|
| 62 |
+
dateparser
|
| 63 |
debugpy
|
| 64 |
decorator
|
| 65 |
+
deepseek
|
| 66 |
defusedxml
|
| 67 |
Deprecated
|
| 68 |
+
dill
|
| 69 |
+
distro
|
| 70 |
dnspython
|
| 71 |
+
docker-pycreds
|
| 72 |
+
docopt
|
| 73 |
duckdb
|
| 74 |
durationpy
|
| 75 |
+
einops
|
| 76 |
email_validator
|
| 77 |
+
encodec
|
| 78 |
entrypoints
|
| 79 |
exceptiongroup
|
| 80 |
executing
|
|
|
|
|
|
|
| 81 |
fastapi
|
| 82 |
fastapi-cli
|
| 83 |
fastjsonschema
|
| 84 |
+
feedparser
|
| 85 |
ffmpy
|
| 86 |
filelock
|
| 87 |
+
Flask
|
| 88 |
flatbuffers
|
| 89 |
fonttools
|
| 90 |
fqdn
|
| 91 |
frozenlist
|
| 92 |
+
fsspec
|
| 93 |
+
g2pkk
|
| 94 |
+
gensim
|
| 95 |
+
gitdb
|
| 96 |
+
GitPython
|
| 97 |
gmpy2
|
| 98 |
+
google-ai-generativelanguage
|
| 99 |
+
google-api-core
|
| 100 |
+
google-api-python-client
|
| 101 |
google-auth
|
| 102 |
+
google-auth-httplib2
|
| 103 |
+
google-generativeai
|
| 104 |
googleapis-common-protos
|
| 105 |
+
gradio
|
| 106 |
+
gradio_client
|
| 107 |
+
groovy
|
| 108 |
+
groq
|
| 109 |
+
grpcio
|
| 110 |
+
grpcio-status
|
| 111 |
+
grpclib
|
| 112 |
+
gruut
|
| 113 |
+
gruut-ipa
|
| 114 |
+
gruut_lang_de
|
| 115 |
+
gruut_lang_en
|
| 116 |
+
gruut_lang_es
|
| 117 |
+
gruut_lang_fr
|
| 118 |
+
gTTS
|
| 119 |
h11
|
| 120 |
h2
|
| 121 |
+
hangul-romanize
|
| 122 |
hnswlib
|
| 123 |
hpack
|
| 124 |
httpcore
|
| 125 |
+
httplib2
|
| 126 |
httptools
|
| 127 |
+
httpx
|
| 128 |
+
httpx-sse
|
| 129 |
+
huggingface-hub
|
| 130 |
humanfriendly
|
| 131 |
hyperframe
|
| 132 |
idna
|
| 133 |
importlib_metadata
|
| 134 |
importlib_resources
|
| 135 |
+
inflect
|
| 136 |
ipykernel
|
| 137 |
ipython
|
| 138 |
ipywidgets
|
| 139 |
isoduration
|
| 140 |
itsdangerous
|
| 141 |
+
jamo
|
| 142 |
jedi
|
| 143 |
+
jieba
|
| 144 |
Jinja2
|
| 145 |
+
jiter
|
| 146 |
+
jiwer
|
| 147 |
joblib
|
| 148 |
json5
|
| 149 |
+
jsonlines
|
| 150 |
+
jsonpatch
|
| 151 |
jsonpointer
|
| 152 |
jsonschema
|
| 153 |
jsonschema-specifications
|
|
|
|
| 164 |
jupyterlab_widgets
|
| 165 |
kiwisolver
|
| 166 |
kubernetes
|
| 167 |
+
# langchain
|
| 168 |
+
langchain-chroma
|
| 169 |
+
langchain-community
|
| 170 |
+
langchain-core
|
| 171 |
+
langchain-openai
|
| 172 |
+
langchain-text-splitters
|
| 173 |
+
langchainplus-sdk
|
| 174 |
+
langcodes
|
| 175 |
+
langsmith
|
| 176 |
+
language_data
|
| 177 |
+
lazy_loader
|
| 178 |
+
librosa
|
| 179 |
+
linkify-it-py
|
| 180 |
+
llvmlite
|
| 181 |
lz4
|
| 182 |
+
marisa-trie
|
| 183 |
+
Markdown
|
| 184 |
+
markdown-it-py
|
| 185 |
MarkupSafe
|
| 186 |
+
marshmallow
|
| 187 |
+
matplotlib
|
| 188 |
matplotlib-inline
|
| 189 |
+
mdit-py-plugins
|
| 190 |
mdurl
|
| 191 |
mistune
|
| 192 |
mmh3
|
| 193 |
+
modal
|
| 194 |
monotonic
|
| 195 |
+
more-itertools
|
| 196 |
mpmath
|
| 197 |
+
msgpack
|
| 198 |
multidict
|
| 199 |
+
multiprocess
|
| 200 |
+
munkres
|
| 201 |
+
murmurhash
|
| 202 |
+
mypy-extensions
|
| 203 |
+
narwhals
|
| 204 |
nbclient
|
| 205 |
nbconvert
|
| 206 |
nbformat
|
| 207 |
nest_asyncio
|
| 208 |
+
networkx
|
| 209 |
+
nltk
|
| 210 |
notebook_shim
|
| 211 |
+
num2words
|
| 212 |
+
numba
|
| 213 |
+
numexpr
|
| 214 |
numpy
|
| 215 |
oauthlib
|
| 216 |
+
ollama
|
| 217 |
onnxruntime
|
| 218 |
+
openai
|
| 219 |
+
openai-whisper
|
| 220 |
+
openapi-schema-pydantic
|
| 221 |
+
opentelemetry-api
|
| 222 |
+
opentelemetry-exporter-otlp-proto-common
|
| 223 |
+
opentelemetry-exporter-otlp-proto-grpc
|
| 224 |
+
opentelemetry-instrumentation
|
| 225 |
+
opentelemetry-instrumentation-asgi
|
| 226 |
+
opentelemetry-instrumentation-fastapi
|
| 227 |
+
opentelemetry-proto
|
| 228 |
+
opentelemetry-sdk
|
| 229 |
+
opentelemetry-semantic-conventions
|
| 230 |
+
opentelemetry-util-http
|
| 231 |
+
orjson
|
| 232 |
+
outcome
|
| 233 |
overrides
|
| 234 |
+
packaging
|
| 235 |
+
pandas
|
| 236 |
pandocfilters
|
| 237 |
parso
|
| 238 |
+
pathtools
|
| 239 |
+
peft
|
| 240 |
pexpect
|
| 241 |
pickleshare
|
| 242 |
pillow
|
| 243 |
pkgutil_resolve_name
|
| 244 |
platformdirs
|
| 245 |
+
plotly
|
| 246 |
+
pooch
|
| 247 |
posthog
|
| 248 |
+
preshed
|
| 249 |
prometheus_client
|
| 250 |
prompt_toolkit
|
| 251 |
propcache
|
| 252 |
+
proto-plus
|
| 253 |
+
protobuf
|
| 254 |
+
psutil
|
| 255 |
ptyprocess
|
| 256 |
pulsar-client
|
| 257 |
pure_eval
|
| 258 |
+
pyarrow
|
| 259 |
pyasn1
|
| 260 |
pyasn1_modules
|
| 261 |
pycparser
|
| 262 |
+
pydantic
|
| 263 |
+
pydantic-settings
|
| 264 |
pydantic_core
|
| 265 |
pydub
|
| 266 |
+
pygame
|
| 267 |
Pygments
|
| 268 |
PyJWT
|
| 269 |
+
pynndescent
|
| 270 |
+
pyobjc
|
| 271 |
+
pyobjc-core
|
| 272 |
+
pyobjc-framework-Accessibility
|
| 273 |
+
pyobjc-framework-Accounts
|
| 274 |
+
pyobjc-framework-AddressBook
|
| 275 |
+
pyobjc-framework-AdServices
|
| 276 |
+
pyobjc-framework-AdSupport
|
| 277 |
+
pyobjc-framework-AppleScriptKit
|
| 278 |
+
pyobjc-framework-AppleScriptObjC
|
| 279 |
+
pyobjc-framework-ApplicationServices
|
| 280 |
+
pyobjc-framework-AppTrackingTransparency
|
| 281 |
+
pyobjc-framework-AudioVideoBridging
|
| 282 |
+
pyobjc-framework-AuthenticationServices
|
| 283 |
+
pyobjc-framework-AutomaticAssessmentConfiguration
|
| 284 |
+
pyobjc-framework-Automator
|
| 285 |
+
pyobjc-framework-AVFoundation
|
| 286 |
+
pyobjc-framework-AVKit
|
| 287 |
+
pyobjc-framework-AVRouting
|
| 288 |
+
pyobjc-framework-BackgroundAssets
|
| 289 |
+
pyobjc-framework-BrowserEngineKit
|
| 290 |
+
pyobjc-framework-BusinessChat
|
| 291 |
+
pyobjc-framework-CoreAudio
|
| 292 |
+
pyobjc-framework-CoreAudioKit
|
| 293 |
+
pyobjc-framework-CoreBluetooth
|
| 294 |
+
pyobjc-framework-CoreData
|
| 295 |
+
pyobjc-framework-CoreHaptics
|
| 296 |
+
pyobjc-framework-CoreLocation
|
| 297 |
+
pyobjc-framework-CoreMedia
|
| 298 |
+
pyobjc-framework-CoreMediaIO
|
| 299 |
+
pyobjc-framework-CoreMIDI
|
| 300 |
+
pyobjc-framework-CoreML
|
| 301 |
+
pyobjc-framework-CoreMotion
|
| 302 |
+
pyobjc-framework-CoreServices
|
| 303 |
+
pyobjc-framework-CoreSpotlight
|
| 304 |
+
pyobjc-framework-CoreText
|
| 305 |
+
pyobjc-framework-CoreWLAN
|
| 306 |
+
pyobjc-framework-CryptoTokenKit
|
| 307 |
+
pyobjc-framework-DataDetection
|
| 308 |
+
pyobjc-framework-DeviceCheck
|
| 309 |
+
pyobjc-framework-DeviceDiscoveryExtension
|
| 310 |
+
pyobjc-framework-DictionaryServices
|
| 311 |
+
pyobjc-framework-DiscRecording
|
| 312 |
+
pyobjc-framework-DiscRecordingUI
|
| 313 |
+
pyobjc-framework-EventKit
|
| 314 |
+
pyobjc-framework-ExceptionHandling
|
| 315 |
+
pyobjc-framework-ExecutionPolicy
|
| 316 |
+
pyobjc-framework-ExtensionKit
|
| 317 |
+
pyobjc-framework-ExternalAccessory
|
| 318 |
+
pyobjc-framework-FileProvider
|
| 319 |
+
pyobjc-framework-FileProviderUI
|
| 320 |
+
pyobjc-framework-FinderSync
|
| 321 |
+
pyobjc-framework-FSEvents
|
| 322 |
+
pyobjc-framework-GameCenter
|
| 323 |
+
pyobjc-framework-GameController
|
| 324 |
+
pyobjc-framework-GameKit
|
| 325 |
+
pyobjc-framework-GameplayKit
|
| 326 |
+
pyobjc-framework-HealthKit
|
| 327 |
+
pyobjc-framework-ImageCaptureCore
|
| 328 |
+
pyobjc-framework-InputMethodKit
|
| 329 |
+
pyobjc-framework-InstallerPlugins
|
| 330 |
+
pyobjc-framework-InstantMessage
|
| 331 |
+
pyobjc-framework-Intents
|
| 332 |
+
pyobjc-framework-IntentsUI
|
| 333 |
+
pyobjc-framework-IOBluetooth
|
| 334 |
+
pyobjc-framework-IOSurface
|
| 335 |
+
pyobjc-framework-iTunesLibrary
|
| 336 |
+
pyobjc-framework-KernelManagement
|
| 337 |
+
pyobjc-framework-LatentSemanticMapping
|
| 338 |
+
pyobjc-framework-LaunchServices
|
| 339 |
+
pyobjc-framework-libdispatch
|
| 340 |
+
pyobjc-framework-libxpc
|
| 341 |
+
pyobjc-framework-LinkPresentation
|
| 342 |
+
pyobjc-framework-LocalAuthentication
|
| 343 |
+
pyobjc-framework-LocalAuthenticationEmbeddedUI
|
| 344 |
+
pyobjc-framework-MailKit
|
| 345 |
+
pyobjc-framework-MapKit
|
| 346 |
+
pyobjc-framework-MediaAccessibility
|
| 347 |
+
pyobjc-framework-MediaExtension
|
| 348 |
+
pyobjc-framework-MediaLibrary
|
| 349 |
+
pyobjc-framework-MediaPlayer
|
| 350 |
+
pyobjc-framework-MediaToolbox
|
| 351 |
+
pyobjc-framework-Metal
|
| 352 |
+
pyobjc-framework-MetalFX
|
| 353 |
+
pyobjc-framework-MetalKit
|
| 354 |
+
pyobjc-framework-MetalPerformanceShaders
|
| 355 |
+
pyobjc-framework-MetalPerformanceShadersGraph
|
| 356 |
+
pyobjc-framework-MetricKit
|
| 357 |
+
pyobjc-framework-MLCompute
|
| 358 |
+
pyobjc-framework-ModelIO
|
| 359 |
+
pyobjc-framework-MultipeerConnectivity
|
| 360 |
+
pyobjc-framework-NaturalLanguage
|
| 361 |
+
pyobjc-framework-NetFS
|
| 362 |
+
pyobjc-framework-Network
|
| 363 |
+
pyobjc-framework-NetworkExtension
|
| 364 |
+
pyobjc-framework-NotificationCenter
|
| 365 |
+
pyobjc-framework-OpenDirectory
|
| 366 |
+
pyobjc-framework-OSAKit
|
| 367 |
+
pyobjc-framework-OSLog
|
| 368 |
+
pyobjc-framework-PassKit
|
| 369 |
+
pyobjc-framework-PencilKit
|
| 370 |
+
pyobjc-framework-PHASE
|
| 371 |
+
pyobjc-framework-Photos
|
| 372 |
+
pyobjc-framework-PhotosUI
|
| 373 |
+
pyobjc-framework-PreferencePanes
|
| 374 |
+
pyobjc-framework-PushKit
|
| 375 |
+
pyobjc-framework-QuickLookThumbnailing
|
| 376 |
+
pyobjc-framework-ReplayKit
|
| 377 |
+
pyobjc-framework-SafariServices
|
| 378 |
+
pyobjc-framework-SafetyKit
|
| 379 |
+
pyobjc-framework-SceneKit
|
| 380 |
+
pyobjc-framework-ScreenCaptureKit
|
| 381 |
+
pyobjc-framework-ScreenSaver
|
| 382 |
+
pyobjc-framework-ScreenTime
|
| 383 |
+
pyobjc-framework-ScriptingBridge
|
| 384 |
+
pyobjc-framework-SearchKit
|
| 385 |
+
pyobjc-framework-Security
|
| 386 |
+
pyobjc-framework-SecurityFoundation
|
| 387 |
+
pyobjc-framework-SecurityInterface
|
| 388 |
+
pyobjc-framework-SensitiveContentAnalysis
|
| 389 |
+
pyobjc-framework-ServiceManagement
|
| 390 |
+
pyobjc-framework-SharedWithYou
|
| 391 |
+
pyobjc-framework-SharedWithYouCore
|
| 392 |
+
pyobjc-framework-ShazamKit
|
| 393 |
+
pyobjc-framework-Social
|
| 394 |
+
pyobjc-framework-SoundAnalysis
|
| 395 |
+
pyobjc-framework-Speech
|
| 396 |
+
pyobjc-framework-SpriteKit
|
| 397 |
+
pyobjc-framework-StoreKit
|
| 398 |
+
pyobjc-framework-Symbols
|
| 399 |
+
pyobjc-framework-SyncServices
|
| 400 |
+
pyobjc-framework-SystemConfiguration
|
| 401 |
+
pyobjc-framework-SystemExtensions
|
| 402 |
+
pyobjc-framework-ThreadNetwork
|
| 403 |
+
pyobjc-framework-UniformTypeIdentifiers
|
| 404 |
+
pyobjc-framework-UserNotifications
|
| 405 |
+
pyobjc-framework-UserNotificationsUI
|
| 406 |
+
pyobjc-framework-VideoSubscriberAccount
|
| 407 |
+
pyobjc-framework-VideoToolbox
|
| 408 |
+
pyobjc-framework-Virtualization
|
| 409 |
+
pyobjc-framework-Vision
|
| 410 |
+
pyobjc-framework-WebKit
|
| 411 |
+
pyOpenSSL
|
| 412 |
+
pyparsing
|
| 413 |
+
PyPDF2
|
| 414 |
+
PyPika
|
| 415 |
+
pypinyin
|
| 416 |
+
pyproject_hooks
|
| 417 |
+
pysbd
|
| 418 |
+
PySocks
|
| 419 |
+
pytesseract
|
| 420 |
+
python-crfsuite
|
| 421 |
+
python-dateutil
|
| 422 |
+
python-dotenv
|
| 423 |
+
python-json-logger
|
| 424 |
+
python-multipart
|
| 425 |
+
pyttsx3
|
| 426 |
+
pytz
|
| 427 |
+
pyu2f
|
| 428 |
+
PyYAML
|
| 429 |
+
pyzmq
|
| 430 |
+
RapidFuzz
|
| 431 |
+
referencing
|
| 432 |
+
regex
|
| 433 |
+
requests
|
| 434 |
+
requests-oauthlib
|
| 435 |
+
requests-toolbelt
|
| 436 |
+
retrying
|
| 437 |
+
rfc3339_validator
|
| 438 |
+
rfc3986-validator
|
| 439 |
+
rich
|
| 440 |
+
rich-toolkit
|
| 441 |
+
rpds-py
|
| 442 |
+
rsa
|
| 443 |
+
ruff
|
| 444 |
+
safehttpx
|
| 445 |
+
safetensors
|
| 446 |
+
scikit-learn
|
| 447 |
+
scipy
|
| 448 |
+
selenium
|
| 449 |
+
semantic-version
|
| 450 |
+
Send2Trash
|
| 451 |
+
sentence-transformers
|
| 452 |
+
sentencepiece
|
| 453 |
+
sentry-sdk
|
| 454 |
+
setproctitle
|
| 455 |
+
sgmllib3k
|
| 456 |
+
shellingham
|
| 457 |
+
sigtools
|
| 458 |
+
simpleaudio
|
| 459 |
+
six
|
| 460 |
+
smart-open
|
| 461 |
+
smmap
|
| 462 |
+
sniffio
|
| 463 |
+
sortedcontainers
|
| 464 |
+
sounddevice
|
| 465 |
+
soundfile
|
| 466 |
+
soupsieve
|
| 467 |
+
soxr
|
| 468 |
+
spaces
|
| 469 |
+
spacy
|
| 470 |
+
spacy-legacy
|
| 471 |
+
spacy-loggers
|
| 472 |
+
SpeechRecognition
|
| 473 |
+
speedtest-cli
|
| 474 |
+
SQLAlchemy
|
| 475 |
+
srsly
|
| 476 |
+
stack_data
|
| 477 |
+
starlette
|
| 478 |
+
SudachiDict-core
|
| 479 |
+
SudachiPy
|
| 480 |
+
sympy
|
| 481 |
+
synchronicity
|
| 482 |
+
tenacity
|
| 483 |
+
tensorboard
|
| 484 |
+
tensorboard-data-server
|
| 485 |
+
terminado
|
| 486 |
+
thinc
|
| 487 |
+
threadpoolctl
|
| 488 |
+
tiktoken
|
| 489 |
+
tinycss2
|
| 490 |
+
tokenizers
|
| 491 |
+
toml
|
| 492 |
+
tomli
|
| 493 |
+
tomlkit
|
| 494 |
+
torch
|
| 495 |
+
torchaudio
|
| 496 |
+
torchvision
|
| 497 |
+
tornado
|
| 498 |
+
tqdm
|
| 499 |
+
trainer
|
| 500 |
+
traitlets
|
| 501 |
+
transformers
|
| 502 |
+
trio
|
| 503 |
+
trio-websocket
|
| 504 |
+
trl
|
| 505 |
+
TTS
|
| 506 |
+
twilio
|
| 507 |
+
typeguard
|
| 508 |
+
typer
|
| 509 |
+
typer-slim
|
| 510 |
+
types-certifi
|
| 511 |
+
types-python-dateutil
|
| 512 |
+
types-toml
|
| 513 |
+
typing-inspect
|
| 514 |
+
typing_extensions
|
| 515 |
+
typing_utils
|
| 516 |
+
tzdata
|
| 517 |
+
tzlocal
|
| 518 |
+
uc-micro-py
|
| 519 |
+
umap
|
| 520 |
+
umap-learn
|
| 521 |
+
unicodedata2
|
| 522 |
+
Unidecode
|
| 523 |
+
uri-template
|
| 524 |
+
uritemplate
|
| 525 |
+
urllib3
|
| 526 |
+
uvicorn
|
| 527 |
+
uvloop
|
| 528 |
+
wandb
|
| 529 |
+
wasabi
|
| 530 |
+
watchfiles
|
| 531 |
+
wcwidth
|
| 532 |
+
weasel
|
| 533 |
+
webcolors
|
| 534 |
+
webdriver-manager
|
| 535 |
+
webencodings
|
| 536 |
+
websocket-client
|
| 537 |
+
websockets
|
| 538 |
+
Werkzeug
|
| 539 |
+
whisper
|
| 540 |
+
widgetsnbextension
|
| 541 |
+
wrapt
|
| 542 |
+
wsproto
|
| 543 |
+
xxhash
|
| 544 |
+
yarl
|
| 545 |
+
zipp
|
| 546 |
+
zstandard
|
services/__pycache__/ui_service.cpython-311.pyc
CHANGED
|
Binary files a/services/__pycache__/ui_service.cpython-311.pyc and b/services/__pycache__/ui_service.cpython-311.pyc differ
|
|
|
services/ui_service.py
CHANGED
|
@@ -6,9 +6,10 @@ import time
|
|
| 6 |
import openai
|
| 7 |
import gradio as gr
|
| 8 |
import threading
|
|
|
|
| 9 |
from typing import List, Dict, Any, Tuple, Optional, Generator
|
| 10 |
|
| 11 |
-
from configs.config import
|
| 12 |
from services.auth_service import (
|
| 13 |
authenticate, create_session, get_session, update_session_activity,
|
| 14 |
end_session, check_inactivity, INACTIVITY_TIMEOUT
|
|
@@ -959,37 +960,39 @@ def general_chat_ui(system_prompt: str, model: str) -> gr.ChatInterface:
|
|
| 959 |
# First, ensure no None values are present in the messages list.
|
| 960 |
messages = [msg for msg in messages if msg is not None]
|
| 961 |
|
| 962 |
-
# RAG Retrieval and Summarization Implementation:
|
| 963 |
if GLOBAL_RETRIEVER is not None:
|
| 964 |
try:
|
| 965 |
# Retrieve relevant documents using the global retriever.
|
| 966 |
docs = GLOBAL_RETRIEVER.get_relevant_documents(message)
|
| 967 |
if docs:
|
| 968 |
-
|
| 969 |
-
|
| 970 |
-
#
|
| 971 |
-
|
| 972 |
-
|
| 973 |
-
|
| 974 |
-
|
| 975 |
-
|
| 976 |
-
|
|
|
|
|
|
|
|
|
|
| 977 |
if summarized_texts:
|
| 978 |
context_text = "\n\n".join(summarized_texts)
|
| 979 |
messages.insert(1, {
|
| 980 |
"role": "system",
|
| 981 |
"content": f"Additional Context Summaries:\n{context_text}",
|
| 982 |
-
"files": []
|
| 983 |
})
|
| 984 |
except Exception as e:
|
| 985 |
print("RAG retrieval failed:", e)
|
| 986 |
-
|
| 987 |
|
| 988 |
chat_history.append({"role": "user", "content": message, "files": []})
|
| 989 |
messages.append({"role": "user", "content": message, "files": []})
|
| 990 |
|
| 991 |
# Call OpenAI's ChatCompletion with streaming enabled.
|
| 992 |
-
completion = openai.
|
| 993 |
model=model,
|
| 994 |
messages=messages,
|
| 995 |
max_tokens=1_000,
|
|
@@ -999,7 +1002,7 @@ def general_chat_ui(system_prompt: str, model: str) -> gr.ChatInterface:
|
|
| 999 |
|
| 1000 |
response = ""
|
| 1001 |
for chunk in completion:
|
| 1002 |
-
token = chunk.choices[0].delta.
|
| 1003 |
response += token
|
| 1004 |
yield response
|
| 1005 |
|
|
@@ -1092,7 +1095,7 @@ def study_support_ui(system_prompt: str, model: str) -> gr.ChatInterface:
|
|
| 1092 |
while attempt < max_retries:
|
| 1093 |
try:
|
| 1094 |
# Use Claude's API for the study support interface
|
| 1095 |
-
result =
|
| 1096 |
model=model,
|
| 1097 |
max_tokens=63_500,
|
| 1098 |
system=system_prompt,
|
|
|
|
| 6 |
import openai
|
| 7 |
import gradio as gr
|
| 8 |
import threading
|
| 9 |
+
import concurrent.futures
|
| 10 |
from typing import List, Dict, Any, Tuple, Optional, Generator
|
| 11 |
|
| 12 |
+
from configs.config import claude_client, GPT4O_MODEL, CLAUDE_MODEL
|
| 13 |
from services.auth_service import (
|
| 14 |
authenticate, create_session, get_session, update_session_activity,
|
| 15 |
end_session, check_inactivity, INACTIVITY_TIMEOUT
|
|
|
|
| 960 |
# First, ensure no None values are present in the messages list.
|
| 961 |
messages = [msg for msg in messages if msg is not None]
|
| 962 |
|
| 963 |
+
# Optimized RAG Retrieval and Summarization Implementation:
|
| 964 |
if GLOBAL_RETRIEVER is not None:
|
| 965 |
try:
|
| 966 |
# Retrieve relevant documents using the global retriever.
|
| 967 |
docs = GLOBAL_RETRIEVER.get_relevant_documents(message)
|
| 968 |
if docs:
|
| 969 |
+
# Use a thread pool to parallelize summarization of each document.
|
| 970 |
+
with concurrent.futures.ThreadPoolExecutor(max_workers=min(len(docs), 5)) as executor:
|
| 971 |
+
# Submit all summarization tasks concurrently.
|
| 972 |
+
futures = [executor.submit(summarize_context, doc.page_content, GPT4O_MODEL) for doc in docs]
|
| 973 |
+
# Collect summarized texts from completed futures.
|
| 974 |
+
summarized_texts = []
|
| 975 |
+
for future in concurrent.futures.as_completed(futures):
|
| 976 |
+
result = future.result() # This waits for each task to complete.
|
| 977 |
+
# Ensure that we get a non-empty result (using .strip() in case of whitespace-only strings).
|
| 978 |
+
if result and result.strip():
|
| 979 |
+
summarized_texts.append(result.strip())
|
| 980 |
+
# If there are any summaries, combine them and insert as additional context.
|
| 981 |
if summarized_texts:
|
| 982 |
context_text = "\n\n".join(summarized_texts)
|
| 983 |
messages.insert(1, {
|
| 984 |
"role": "system",
|
| 985 |
"content": f"Additional Context Summaries:\n{context_text}",
|
| 986 |
+
"files": []
|
| 987 |
})
|
| 988 |
except Exception as e:
|
| 989 |
print("RAG retrieval failed:", e)
|
|
|
|
| 990 |
|
| 991 |
chat_history.append({"role": "user", "content": message, "files": []})
|
| 992 |
messages.append({"role": "user", "content": message, "files": []})
|
| 993 |
|
| 994 |
# Call OpenAI's ChatCompletion with streaming enabled.
|
| 995 |
+
completion = openai.chat.completions.create(
|
| 996 |
model=model,
|
| 997 |
messages=messages,
|
| 998 |
max_tokens=1_000,
|
|
|
|
| 1002 |
|
| 1003 |
response = ""
|
| 1004 |
for chunk in completion:
|
| 1005 |
+
token = chunk.choices[0].delta.content or ""
|
| 1006 |
response += token
|
| 1007 |
yield response
|
| 1008 |
|
|
|
|
| 1095 |
while attempt < max_retries:
|
| 1096 |
try:
|
| 1097 |
# Use Claude's API for the study support interface
|
| 1098 |
+
result = claude_client.messages.stream(
|
| 1099 |
model=model,
|
| 1100 |
max_tokens=63_500,
|
| 1101 |
system=system_prompt,
|