File size: 315 Bytes
b6cbf9a
 
 
 
 
 
e441004
fab135b
 
6c69fdb
fab135b
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from fastapi import FastAPI
from transformers import pipeline
 
# Create a new FastAPI app instance
app = FastAPI()
 
pipe = pipeline("text2text-generation", 
model="mat27/medmnistPrueba")

@app.get("/generate")
def generate(imagen: np.array):
    
    output = pipe(imagen)
    
    return {"Precisión: ": output}