- rag.py +6 -4
- requirements.txt +10 -10
rag.py
CHANGED
|
@@ -1,17 +1,19 @@
|
|
| 1 |
-
# rag.py (
|
| 2 |
from __future__ import annotations
|
| 3 |
import os, uuid, tempfile, requests, shutil, re
|
| 4 |
from pathlib import Path
|
| 5 |
from functools import lru_cache
|
| 6 |
from typing import List, Tuple
|
| 7 |
from datasets import load_dataset
|
| 8 |
-
from langchain.text_splitter import RecursiveCharacterTextSplitter # ← exists in 0.3
|
| 9 |
from langchain_community.vectorstores import FAISS
|
| 10 |
from langchain_huggingface import HuggingFaceEmbeddings, HuggingFaceEndpoint
|
| 11 |
from langchain_core.prompts import PromptTemplate
|
| 12 |
-
from langchain.chains import RetrievalQA # ← exists in 0.3
|
| 13 |
from supabase import create_client
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
HF_DS = "NimrodDev/LD_Events2"
|
| 16 |
EMBED_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
|
| 17 |
LLM_MODEL = "microsoft/DialoGPT-medium"
|
|
|
|
| 1 |
+
# rag.py (v8 – exact imports in 0.3.7 wheels)
|
| 2 |
from __future__ import annotations
|
| 3 |
import os, uuid, tempfile, requests, shutil, re
|
| 4 |
from pathlib import Path
|
| 5 |
from functools import lru_cache
|
| 6 |
from typing import List, Tuple
|
| 7 |
from datasets import load_dataset
|
| 8 |
+
from langchain.text_splitter import RecursiveCharacterTextSplitter # ← exists in 0.3.7
|
| 9 |
from langchain_community.vectorstores import FAISS
|
| 10 |
from langchain_huggingface import HuggingFaceEmbeddings, HuggingFaceEndpoint
|
| 11 |
from langchain_core.prompts import PromptTemplate
|
| 12 |
+
from langchain.chains import RetrievalQA # ← exists in 0.3.7
|
| 13 |
from supabase import create_client
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
#________________________config_________________#
|
| 17 |
HF_DS = "NimrodDev/LD_Events2"
|
| 18 |
EMBED_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
|
| 19 |
LLM_MODEL = "microsoft/DialoGPT-medium"
|
requirements.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
flask
|
| 2 |
-
langchain
|
| 3 |
-
langchain-community
|
| 4 |
-
langchain-huggingface
|
| 5 |
-
sentence-transformers
|
| 6 |
-
faiss-cpu
|
| 7 |
-
datasets
|
| 8 |
-
supabase
|
| 9 |
-
python-dotenv
|
| 10 |
-
gunicorn
|
|
|
|
| 1 |
+
flask==3.0.3
|
| 2 |
+
langchain==0.3.7
|
| 3 |
+
langchain-community==0.3.7
|
| 4 |
+
langchain-huggingface==0.1.2
|
| 5 |
+
sentence-transformers==3.0.1
|
| 6 |
+
faiss-cpu==1.9.0
|
| 7 |
+
datasets==3.0.1
|
| 8 |
+
supabase==2.6.0.post1
|
| 9 |
+
python-dotenv==1.0.1
|
| 10 |
+
gunicorn==23.0.0
|