Spaces:
Sleeping
Sleeping
Prathamesh Sable
commited on
Commit
·
1c3465f
1
Parent(s):
cca8343
import fixes
Browse files- .gitignore +2 -1
- app.py +6 -11
- log.txt +0 -98
.gitignore
CHANGED
|
@@ -5,4 +5,5 @@ chroma_db
|
|
| 5 |
chroma
|
| 6 |
/trash
|
| 7 |
uploads/
|
| 8 |
-
/flask_session
|
|
|
|
|
|
| 5 |
chroma
|
| 6 |
/trash
|
| 7 |
uploads/
|
| 8 |
+
/flask_session
|
| 9 |
+
log.txt
|
app.py
CHANGED
|
@@ -1,22 +1,20 @@
|
|
| 1 |
-
import time
|
| 2 |
from flask import Flask,request, jsonify,session
|
| 3 |
from flask import render_template
|
| 4 |
from flask_session import Session
|
| 5 |
from werkzeug.utils import secure_filename
|
| 6 |
from apscheduler.schedulers.background import BackgroundScheduler
|
| 7 |
|
| 8 |
-
from langchain.document_loaders import DirectoryLoader,PyPDFLoader,UnstructuredWordDocumentLoader,TextLoader,UnstructuredHTMLLoader,UnstructuredMarkdownLoader
|
| 9 |
-
|
| 10 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
from langchain.embeddings.huggingface import HuggingFaceInferenceAPIEmbeddings
|
| 13 |
from langchain_chroma import Chroma
|
| 14 |
from chromadb import Client
|
| 15 |
|
| 16 |
-
import google.generativeai as genai
|
| 17 |
-
|
| 18 |
-
from dotenv import load_dotenv
|
| 19 |
import os
|
|
|
|
|
|
|
| 20 |
import shutil
|
| 21 |
import logging
|
| 22 |
|
|
@@ -199,10 +197,7 @@ def remove_file():
|
|
| 199 |
def shutdown_scheduler(exception=None):
|
| 200 |
scheduler.shutdown()
|
| 201 |
|
| 202 |
-
def main():
|
| 203 |
-
app.run(host="0.0.0.0",port=8000,debug=True)
|
| 204 |
-
|
| 205 |
if __name__ == "__main__":
|
| 206 |
-
|
| 207 |
|
| 208 |
|
|
|
|
|
|
|
| 1 |
from flask import Flask,request, jsonify,session
|
| 2 |
from flask import render_template
|
| 3 |
from flask_session import Session
|
| 4 |
from werkzeug.utils import secure_filename
|
| 5 |
from apscheduler.schedulers.background import BackgroundScheduler
|
| 6 |
|
|
|
|
|
|
|
| 7 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 8 |
+
from langchain_community.document_loaders import PyPDFLoader,UnstructuredWordDocumentLoader,TextLoader,UnstructuredHTMLLoader,UnstructuredMarkdownLoader
|
| 9 |
+
from langchain_community.embeddings import HuggingFaceInferenceAPIEmbeddings
|
| 10 |
+
import google.generativeai as genai
|
| 11 |
|
|
|
|
| 12 |
from langchain_chroma import Chroma
|
| 13 |
from chromadb import Client
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
import os
|
| 16 |
+
from dotenv import load_dotenv
|
| 17 |
+
import time
|
| 18 |
import shutil
|
| 19 |
import logging
|
| 20 |
|
|
|
|
| 197 |
def shutdown_scheduler(exception=None):
|
| 198 |
scheduler.shutdown()
|
| 199 |
|
|
|
|
|
|
|
|
|
|
| 200 |
if __name__ == "__main__":
|
| 201 |
+
app.run(host="0.0.0.0",port=8000,debug=True)
|
| 202 |
|
| 203 |
|
log.txt
CHANGED
|
@@ -1,98 +0,0 @@
|
|
| 1 |
-
2024-12-06 14:02:03,186 - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
|
| 2 |
-
2024-12-06 14:02:03,499 - DEBUG - Starting component System
|
| 3 |
-
2024-12-06 14:02:03,499 - DEBUG - Starting component Posthog
|
| 4 |
-
2024-12-06 14:02:03,499 - DEBUG - Starting component OpenTelemetryClient
|
| 5 |
-
2024-12-06 14:02:03,499 - DEBUG - Starting component SqliteDB
|
| 6 |
-
2024-12-06 14:02:03,501 - DEBUG - Starting component SimpleQuotaEnforcer
|
| 7 |
-
2024-12-06 14:02:03,501 - DEBUG - Starting component SimpleRateLimitEnforcer
|
| 8 |
-
2024-12-06 14:02:03,501 - DEBUG - Starting component LocalSegmentManager
|
| 9 |
-
2024-12-06 14:02:03,501 - DEBUG - Starting component LocalExecutor
|
| 10 |
-
2024-12-06 14:02:03,501 - DEBUG - Starting component SegmentAPI
|
| 11 |
-
2024-12-06 14:02:03,519 - DEBUG - Looking up time zone info from registry
|
| 12 |
-
2024-12-06 14:02:03,542 - INFO - Adding job tentatively -- it will be properly scheduled when the scheduler starts
|
| 13 |
-
2024-12-06 14:02:03,542 - INFO - Added job "cleanup_resources" to job store "default"
|
| 14 |
-
2024-12-06 14:02:03,542 - INFO - Scheduler started
|
| 15 |
-
2024-12-06 14:02:03,542 - DEBUG - Looking for jobs to run
|
| 16 |
-
2024-12-06 14:02:03,548 - DEBUG - Next wakeup is due at 2024-12-06 14:07:03.542688+05:30 (in 299.993982 seconds)
|
| 17 |
-
2024-12-06 14:02:03,567 - WARNING - * Debugger is active!
|
| 18 |
-
2024-12-06 14:02:03,567 - INFO - * Debugger PIN: 471-334-865
|
| 19 |
-
2024-12-06 14:02:04,024 - DEBUG - Starting new HTTPS connection (1): us.i.posthog.com:443
|
| 20 |
-
2024-12-06 14:02:05,409 - DEBUG - https://us.i.posthog.com:443 "POST /batch/ HTTP/11" 200 15
|
| 21 |
-
2024-12-06 14:07:03,556 - DEBUG - Looking for jobs to run
|
| 22 |
-
2024-12-06 14:07:03,556 - INFO - Running job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:07:03 IST)" (scheduled at 2024-12-06 14:07:03.542688+05:30)
|
| 23 |
-
2024-12-06 14:07:03,556 - DEBUG - Next wakeup is due at 2024-12-06 14:12:03.542688+05:30 (in 299.985749 seconds)
|
| 24 |
-
2024-12-06 14:07:03,565 - INFO - Deleted expired file: uploads\20_DSA_patterns_.pdf
|
| 25 |
-
2024-12-06 14:07:03,565 - INFO - Deleted expired file: uploads\a16-ahn.pdf
|
| 26 |
-
2024-12-06 14:07:03,565 - INFO - Deleted expired file: uploads\blank_page.pdf
|
| 27 |
-
2024-12-06 14:07:03,565 - INFO - Deleted expired file: uploads\Complete_Git_Cheat_Sheet.pdf
|
| 28 |
-
2024-12-06 14:07:03,571 - INFO - Deleted expired file: uploads\E150000182706715682136.PDF
|
| 29 |
-
2024-12-06 14:07:03,573 - INFO - Deleted expired file: uploads\Prathamesh_Sable_Resume.pdf
|
| 30 |
-
2024-12-06 14:07:03,573 - INFO - Deleted expired file: uploads\README.md
|
| 31 |
-
2024-12-06 14:07:03,573 - INFO - Job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:12:03 IST)" executed successfully
|
| 32 |
-
2024-12-06 14:12:03,550 - DEBUG - Looking for jobs to run
|
| 33 |
-
2024-12-06 14:12:03,550 - DEBUG - Next wakeup is due at 2024-12-06 14:17:03.542688+05:30 (in 299.992333 seconds)
|
| 34 |
-
2024-12-06 14:12:03,550 - INFO - Running job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:17:03 IST)" (scheduled at 2024-12-06 14:12:03.542688+05:30)
|
| 35 |
-
2024-12-06 14:12:03,550 - INFO - Job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:17:03 IST)" executed successfully
|
| 36 |
-
2024-12-06 14:17:03,550 - DEBUG - Looking for jobs to run
|
| 37 |
-
2024-12-06 14:17:03,550 - DEBUG - Next wakeup is due at 2024-12-06 14:22:03.542688+05:30 (in 299.991993 seconds)
|
| 38 |
-
2024-12-06 14:17:03,550 - INFO - Running job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:22:03 IST)" (scheduled at 2024-12-06 14:17:03.542688+05:30)
|
| 39 |
-
2024-12-06 14:17:03,550 - INFO - Job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:22:03 IST)" executed successfully
|
| 40 |
-
2024-12-06 14:22:03,548 - DEBUG - Looking for jobs to run
|
| 41 |
-
2024-12-06 14:22:03,549 - DEBUG - Next wakeup is due at 2024-12-06 14:27:03.542688+05:30 (in 299.992908 seconds)
|
| 42 |
-
2024-12-06 14:22:03,549 - INFO - Running job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:27:03 IST)" (scheduled at 2024-12-06 14:22:03.542688+05:30)
|
| 43 |
-
2024-12-06 14:22:03,549 - INFO - Job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:27:03 IST)" executed successfully
|
| 44 |
-
2024-12-06 14:27:03,559 - DEBUG - Looking for jobs to run
|
| 45 |
-
2024-12-06 14:27:03,559 - DEBUG - Next wakeup is due at 2024-12-06 14:32:03.542688+05:30 (in 299.983279 seconds)
|
| 46 |
-
2024-12-06 14:27:03,559 - INFO - Running job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:32:03 IST)" (scheduled at 2024-12-06 14:27:03.542688+05:30)
|
| 47 |
-
2024-12-06 14:27:03,559 - INFO - Job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:32:03 IST)" executed successfully
|
| 48 |
-
2024-12-06 14:32:03,558 - DEBUG - Looking for jobs to run
|
| 49 |
-
2024-12-06 14:32:03,558 - DEBUG - Next wakeup is due at 2024-12-06 14:37:03.542688+05:30 (in 299.983849 seconds)
|
| 50 |
-
2024-12-06 14:32:03,565 - INFO - Running job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:37:03 IST)" (scheduled at 2024-12-06 14:32:03.542688+05:30)
|
| 51 |
-
2024-12-06 14:32:03,565 - INFO - Job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:37:03 IST)" executed successfully
|
| 52 |
-
2024-12-06 14:37:03,558 - DEBUG - Looking for jobs to run
|
| 53 |
-
2024-12-06 14:37:03,566 - DEBUG - Next wakeup is due at 2024-12-06 14:42:03.542688+05:30 (in 299.976199 seconds)
|
| 54 |
-
2024-12-06 14:37:03,566 - INFO - Running job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:42:03 IST)" (scheduled at 2024-12-06 14:37:03.542688+05:30)
|
| 55 |
-
2024-12-06 14:37:03,568 - INFO - Job "cleanup_resources (trigger: interval[0:05:00], next run at: 2024-12-06 14:42:03 IST)" executed successfully
|
| 56 |
-
2024-12-06 14:40:58,432 - INFO - * Detected change in 'D:\\Coding\\Multi-File-Chatting\\app.py', reloading
|
| 57 |
-
2024-12-06 14:41:07,871 - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
|
| 58 |
-
2024-12-06 14:41:08,298 - DEBUG - Starting component System
|
| 59 |
-
2024-12-06 14:41:08,298 - DEBUG - Starting component Posthog
|
| 60 |
-
2024-12-06 14:41:08,298 - DEBUG - Starting component OpenTelemetryClient
|
| 61 |
-
2024-12-06 14:41:08,298 - DEBUG - Starting component SqliteDB
|
| 62 |
-
2024-12-06 14:41:08,322 - DEBUG - Starting component SimpleQuotaEnforcer
|
| 63 |
-
2024-12-06 14:41:08,322 - DEBUG - Starting component SimpleRateLimitEnforcer
|
| 64 |
-
2024-12-06 14:41:08,323 - DEBUG - Starting component LocalSegmentManager
|
| 65 |
-
2024-12-06 14:41:08,323 - DEBUG - Starting component LocalExecutor
|
| 66 |
-
2024-12-06 14:41:08,323 - DEBUG - Starting component SegmentAPI
|
| 67 |
-
2024-12-06 14:41:08,327 - DEBUG - Looking up time zone info from registry
|
| 68 |
-
2024-12-06 14:41:08,340 - INFO - Adding job tentatively -- it will be properly scheduled when the scheduler starts
|
| 69 |
-
2024-12-06 14:41:08,340 - INFO - Added job "cleanup_resources" to job store "default"
|
| 70 |
-
2024-12-06 14:41:08,341 - INFO - Scheduler started
|
| 71 |
-
2024-12-06 14:41:08,341 - DEBUG - Looking for jobs to run
|
| 72 |
-
2024-12-06 14:41:08,344 - DEBUG - Next wakeup is due at 2024-12-06 14:46:08.340975+05:30 (in 299.996005 seconds)
|
| 73 |
-
2024-12-06 14:41:08,371 - WARNING - * Debugger is active!
|
| 74 |
-
2024-12-06 14:41:08,381 - INFO - * Debugger PIN: 471-334-865
|
| 75 |
-
2024-12-06 14:41:08,839 - DEBUG - Starting new HTTPS connection (1): us.i.posthog.com:443
|
| 76 |
-
2024-12-06 14:41:10,082 - DEBUG - https://us.i.posthog.com:443 "POST /batch/ HTTP/11" 200 15
|
| 77 |
-
2024-12-06 14:45:48,701 - INFO - * Detected change in 'D:\\Coding\\Multi-File-Chatting\\app.py', reloading
|
| 78 |
-
2024-12-06 14:45:56,500 - INFO - Anonymized telemetry enabled. See https://docs.trychroma.com/telemetry for more information.
|
| 79 |
-
2024-12-06 14:45:56,772 - DEBUG - Starting component System
|
| 80 |
-
2024-12-06 14:45:56,772 - DEBUG - Starting component Posthog
|
| 81 |
-
2024-12-06 14:45:56,772 - DEBUG - Starting component OpenTelemetryClient
|
| 82 |
-
2024-12-06 14:45:56,772 - DEBUG - Starting component SqliteDB
|
| 83 |
-
2024-12-06 14:45:56,799 - DEBUG - Starting component SimpleQuotaEnforcer
|
| 84 |
-
2024-12-06 14:45:56,799 - DEBUG - Starting component SimpleRateLimitEnforcer
|
| 85 |
-
2024-12-06 14:45:56,799 - DEBUG - Starting component LocalSegmentManager
|
| 86 |
-
2024-12-06 14:45:56,799 - DEBUG - Starting component LocalExecutor
|
| 87 |
-
2024-12-06 14:45:56,799 - DEBUG - Starting component SegmentAPI
|
| 88 |
-
2024-12-06 14:45:56,802 - DEBUG - Looking up time zone info from registry
|
| 89 |
-
2024-12-06 14:45:56,802 - INFO - Adding job tentatively -- it will be properly scheduled when the scheduler starts
|
| 90 |
-
2024-12-06 14:45:56,802 - INFO - Added job "cleanup_resources" to job store "default"
|
| 91 |
-
2024-12-06 14:45:56,802 - INFO - Scheduler started
|
| 92 |
-
2024-12-06 14:45:56,802 - DEBUG - Looking for jobs to run
|
| 93 |
-
2024-12-06 14:45:56,802 - DEBUG - Next wakeup is due at 2024-12-06 14:50:56.802779+05:30 (in 300.000000 seconds)
|
| 94 |
-
2024-12-06 14:45:56,818 - WARNING - * Debugger is active!
|
| 95 |
-
2024-12-06 14:45:56,834 - INFO - * Debugger PIN: 471-334-865
|
| 96 |
-
2024-12-06 14:45:57,307 - DEBUG - Starting new HTTPS connection (1): us.i.posthog.com:443
|
| 97 |
-
2024-12-06 14:45:58,410 - INFO - * Detected change in 'D:\\Coding\\Multi-File-Chatting\\utils.py', reloading
|
| 98 |
-
2024-12-06 14:45:58,591 - DEBUG - https://us.i.posthog.com:443 "POST /batch/ HTTP/11" 200 15
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|