File size: 305 Bytes
e42e5e9
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from fastapi import FastAPI, File
from transformers import pipeline

app = FastAPI()
vision_model = pipeline("image-analysis", model="tmmdev/chart-vision-analyzer")

@app.post("/analyze")
async def analyze_chart(image: File):
    analysis = vision_model(image)
    return {"analysis": analysis}