Spaces:
Runtime error
Runtime error
Download src/api/server.py from NandiniKodali/smartmatch: direct link, hf CLI and curl.
- Browser
- Download file 407 Bytes
-
https://huggingface.co/spaces/NandiniKodali/smartmatch/resolve/main/src/api/server.py
- Command line
-
hf download hf://spaces/NandiniKodali/smartmatch/src/api/server.py
-
curl -L -o server.py https://huggingface.co/spaces/NandiniKodali/smartmatch/resolve/main/src/api/server.py
407 Bytes
| from fastapi import FastAPI | |
| from src.pipeline.run_pipeline_updated import run_pipeline | |
| app = FastAPI() | |
| def root(): | |
| return {"message": "SmartMatch API running"} | |
| def match(text: str): | |
| results = run_pipeline(text) | |
| # handle different pipeline outputs safely | |
| if isinstance(results, list): | |
| return {"results": results} | |
| return {"output": results} |