Spaces:
Runtime error
Runtime error
Update app/main.py
Browse files- app/main.py +2 -4
app/main.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.middleware.cors import CORSMiddleware
|
3 |
from contextlib import asynccontextmanager
|
4 |
-
from
|
5 |
from app.api import analysis,reports,infos,chatbot
|
6 |
from langchain_community.chat_models import ChatOpenAI
|
7 |
from langchain_community.vectorstores import FAISS
|
@@ -22,9 +22,7 @@ os.environ["HF_HOME"] = "/tmp/cache"
|
|
22 |
async def lifespan(app: FastAPI):
|
23 |
embedding_model = HuggingFaceEmbeddings(
|
24 |
|
25 |
-
model_name="sentence-transformers/all-MiniLM-L6-v2"
|
26 |
-
model_kwargs={"cache_folder": "/tmp/cache","use_auth_token": HUGGINGFACE_API_KEY} # ou sans si pas nécessaire
|
27 |
-
)
|
28 |
|
29 |
|
30 |
vectorstore = await asyncio.to_thread(
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from fastapi.middleware.cors import CORSMiddleware
|
3 |
from contextlib import asynccontextmanager
|
4 |
+
from langchain_community.embeddings import HuggingFaceEmbeddings
|
5 |
from app.api import analysis,reports,infos,chatbot
|
6 |
from langchain_community.chat_models import ChatOpenAI
|
7 |
from langchain_community.vectorstores import FAISS
|
|
|
22 |
async def lifespan(app: FastAPI):
|
23 |
embedding_model = HuggingFaceEmbeddings(
|
24 |
|
25 |
+
model_name="sentence-transformers/all-MiniLM-L6-v2")
|
|
|
|
|
26 |
|
27 |
|
28 |
vectorstore = await asyncio.to_thread(
|