Update main.py
Browse files
main.py
CHANGED
|
@@ -5,7 +5,7 @@ except ImportError: # pip < 10.0
|
|
| 5 |
pkgs = freeze.freeze()
|
| 6 |
for pkg in pkgs: print(pkg)
|
| 7 |
import os
|
| 8 |
-
from fastapi import FastAPI, HTTPException, File, UploadFile
|
| 9 |
from fastapi.middleware.cors import CORSMiddleware
|
| 10 |
from PyPDF2 import PdfReader
|
| 11 |
import google.generativeai as genai
|
|
@@ -78,7 +78,7 @@ def vision(file_content):
|
|
| 78 |
|
| 79 |
|
| 80 |
@app.post("/get_ocr_data/")
|
| 81 |
-
async def get_data(input_file: UploadFile = File(...)):
|
| 82 |
#try:
|
| 83 |
# Determine the file type by reading the first few bytes
|
| 84 |
file_content = await input_file.read()
|
|
|
|
| 5 |
pkgs = freeze.freeze()
|
| 6 |
for pkg in pkgs: print(pkg)
|
| 7 |
import os
|
| 8 |
+
from fastapi import FastAPI, HTTPException, File, UploadFile,Query
|
| 9 |
from fastapi.middleware.cors import CORSMiddleware
|
| 10 |
from PyPDF2 import PdfReader
|
| 11 |
import google.generativeai as genai
|
|
|
|
| 78 |
|
| 79 |
|
| 80 |
@app.post("/get_ocr_data/")
|
| 81 |
+
async def get_data(user_id: str = Query(...),input_file: UploadFile = File(...)):
|
| 82 |
#try:
|
| 83 |
# Determine the file type by reading the first few bytes
|
| 84 |
file_content = await input_file.read()
|