Spaces:
Sleeping
Sleeping
Update api/data_extractor.py
Browse files- api/data_extractor.py +2 -1
api/data_extractor.py
CHANGED
@@ -7,6 +7,7 @@ import os, io, base64
|
|
7 |
import json
|
8 |
import re
|
9 |
from typing import List, Dict, Any
|
|
|
10 |
|
11 |
# Move configuration and constants to separate files
|
12 |
from .config import MONGODB_URL, OPENAI_API_KEY
|
@@ -19,7 +20,7 @@ mongodb_client = MongoClient(MONGODB_URL)
|
|
19 |
db = mongodb_client.consumeWise
|
20 |
collection = db.products
|
21 |
print(f"collection is {collection}")
|
22 |
-
|
23 |
|
24 |
def encode_image(uploaded_file):
|
25 |
return base64.b64encode(uploaded_file.read()).decode('utf-8')
|
|
|
7 |
import json
|
8 |
import re
|
9 |
from typing import List, Dict, Any
|
10 |
+
from fastapi import FastAPI
|
11 |
|
12 |
# Move configuration and constants to separate files
|
13 |
from .config import MONGODB_URL, OPENAI_API_KEY
|
|
|
20 |
db = mongodb_client.consumeWise
|
21 |
collection = db.products
|
22 |
print(f"collection is {collection}")
|
23 |
+
app = FastAPI()
|
24 |
|
25 |
def encode_image(uploaded_file):
|
26 |
return base64.b64encode(uploaded_file.read()).decode('utf-8')
|