embedding / app.py
jwlee-ai's picture
test
e9502c9
raw
history blame contribute delete
445 Bytes
from fastapi import FastAPI
from embedding import PDFEmbedding
app = FastAPI()
@app.get("/")
def greet_json():
return {"Hello": "World!"}
# API ์—”๋“œํฌ์ธํŠธ๋กœ ์ด๋™๋จ
# app.py์˜ ๋‹ค์Œ ์ฝ”๋“œ ์ฐธ์กฐ:
@app.post("/process")
def process_pdfs():
pdf_embedding = PDFEmbedding(
model_path="../ai_models/hf/BGE-m3-ko",
pdf_dir="./data/pdf"
)
pdf_embedding.process_and_store()
return {"status": "success"}