Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -515,13 +515,15 @@ def base64_in_immagine(dati_base64):
|
|
| 515 |
|
| 516 |
@app.post("/Image_To_Text")
|
| 517 |
def image_to_text(request: Request, input_data: InputImageToText):
|
| 518 |
-
base64_in_immagine(
|
|
|
|
| 519 |
client = Client("vikhyatk/moondream2")
|
| 520 |
result = client.predict(
|
| 521 |
"img.jpg",
|
| 522 |
-
"
|
| 523 |
api_name="/answer_question_1"
|
| 524 |
)
|
|
|
|
| 525 |
return {"response": result}
|
| 526 |
|
| 527 |
#--------------------------------------------------- API PostSpazio ------------------------------------------------------
|
|
|
|
| 515 |
|
| 516 |
@app.post("/Image_To_Text")
|
| 517 |
def image_to_text(request: Request, input_data: InputImageToText):
|
| 518 |
+
base64_in_immagine(input_data.base64)
|
| 519 |
+
print(input_data.base64)
|
| 520 |
client = Client("vikhyatk/moondream2")
|
| 521 |
result = client.predict(
|
| 522 |
"img.jpg",
|
| 523 |
+
"",
|
| 524 |
api_name="/answer_question_1"
|
| 525 |
)
|
| 526 |
+
print(result)
|
| 527 |
return {"response": result}
|
| 528 |
|
| 529 |
#--------------------------------------------------- API PostSpazio ------------------------------------------------------
|