Spaces:
Runtime error
Runtime error
| from fastapi import FastAPI, UploadFile | |
| from fastapi.middleware.cors import CORSMiddleware | |
| import utils.handle as handle | |
| app = FastAPI() | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| async def training_data_from_utags_json(file: UploadFile, savePath: str): | |
| return handle.trainingDataFromUTagsJSON(file, savePath) | |
| async def training_data_from_prompts_for_bert(file: UploadFile, savePath: str): | |
| return handle.trainingDataFromPromptsForBERT(file, savePath) | |
| async def augment_data_using_vector_space_algorithm(file: UploadFile, savePath: str): | |
| return handle.augmentDataUsingVectorSpaceAlgorithm(file, savePath) | |
| async def get_symptoms_causes_and_disease_name_from_json(file: UploadFile, savePath: str): | |
| return handle.getSymptomsCausesAndDiseaseNameFromJSON(file, savePath) | |
| async def train_model_on_sagemaker(trainDataPath: str, testDataPath: str, file: UploadFile | None = None): | |
| return handle.trainModelOnSageMaker(trainDataPath, testDataPath, file) |