danilohssantana commited on
Commit
7c13927
·
1 Parent(s): 5dd1cbf

fixing endpoint call

Browse files
Files changed (2) hide show
  1. main.py +2 -2
  2. model.py +1 -1
main.py CHANGED
@@ -85,8 +85,8 @@ async def upload_and_encode_image(file: UploadFile = File(...)):
85
  except Exception as e:
86
  raise HTTPException(status_code=400, detail=f"Invalid file: {e}")
87
 
88
- @app.get("/predict")
89
- def predict(data: str = Query(...), prompt: str = Query(...)):
90
  """
91
  Generates a description for an image using the Qwen-2-VL model.
92
 
 
85
  except Exception as e:
86
  raise HTTPException(status_code=400, detail=f"Invalid file: {e}")
87
 
88
+ @app.post("/predict")
89
+ def predict(data: any = Query(...)):
90
  """
91
  Generates a description for an image using the Qwen-2-VL model.
92
 
model.py CHANGED
@@ -28,7 +28,7 @@ predict_payload = {
28
  "prompt": "describe the image",
29
  }
30
 
31
- predict_response = requests.get(f"{BASE_URL}/predict", params=predict_payload)
32
 
33
  # Step 4: Print the response
34
  if predict_response.status_code == 200:
 
28
  "prompt": "describe the image",
29
  }
30
 
31
+ predict_response = requests.post(f"{BASE_URL}/predict", params=predict_payload)
32
 
33
  # Step 4: Print the response
34
  if predict_response.status_code == 200: