File size: 375 Bytes
b6cbf9a
 
00991f2
5e412ed
 
b6cbf9a
 
 
 
314e5ae
b0972cc
00991f2
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from fastapi import FastAPI
from transformers import pipeline
import numpy as np
import os
os.environ['TRANSFORMERS_CACHE'] = '/blabla/cache/'
 
# Create a new FastAPI app instance
app = FastAPI()
 
pipe = pipeline(model="mat27/medmnistPrueba")

def generate(image: np.array):
    """
    Input: imagen
    """
    output = pipe(image)
     
    return {"output": output[0]}