petrockapi / routers /training.py
woods-today
Working on it
430abad
raw
history blame
529 Bytes
from fastapi import APIRouter, Form, BackgroundTasks
from config import settings
import os
import json
from routers.donut_evaluate import run_evaluate_donut
from routers.donut_training import run_training_donut
import utils
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16)
router = APIRouter()
@router.get("/hi")
async def hifunction():
prompt = "a photograph of an astronaut riding a horse"
image = pipe(prompt).images[0]
return [image]