Spaces:
Running
Running
from fastapi import FastAPI | |
import joblib | |
import numpy as np | |
app = FastAPI() | |
# Load your trained model | |
model = joblib.load("SVM.joblib") # Ensure this file is in the correct directory | |
def home(): | |
return {"message": "AMP Classifier API is running!"} | |
def predict(sequence: str): | |
# Convert sequence to features (modify if needed) | |
features = np.array([len(sequence)]) # Example: length of sequence | |
prediction = model.predict([features]) | |
return {"sequence": sequence, "is_AMP": bool(prediction[0])} | |