chart-analyzer / generator_endpoint.py
tmmdev's picture
Upload 13 files
e42e5e9 verified
raw
history blame
374 Bytes
from fastapi import FastAPI
from transformers import pipeline
app = FastAPI()
chart_generator = pipeline("text-generation", model="tmmdev/chart-generator")
@app.post("/generate")
async def generate_charts(data: dict):
charts = chart_generator(data)
return {
"interactive_charts": charts.charts,
"pattern_images": charts.patterns
}