File size: 764 Bytes
b917742
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from fastapi import FastAPI
import uvicorn

# Create a FastAPI app for Hugging Face Spaces
app = FastAPI(title="Collinear API")

@app.get("/")
async def root():
    return {"message": "Welcome to Collinear API"}

@app.get("/health")
async def health():
    return {"status": "healthy"}

# Add more API endpoints here as needed
@app.get("/api/datasets")
async def list_datasets():
    return {
        "datasets": [
            {"id": "1", "name": "Sample Dataset 1", "description": "Example dataset for demonstration"},
            {"id": "2", "name": "Sample Dataset 2", "description": "Another example dataset"}
        ]
    }

if __name__ == "__main__":
    # This is used when running locally
    uvicorn.run("app:app", host="0.0.0.0", port=7860, reload=True)