Instructions to use prelington/OrcaleSeek with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fastText
How to use prelington/OrcaleSeek with fastText:
from huggingface_hub import hf_hub_download import fasttext model = fasttext.load_model(hf_hub_download("prelington/OrcaleSeek", "model.bin")) - Notebooks
- Google Colab
- Kaggle
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from pydantic import BaseModel | |
| from transformers import pipeline | |
| import uvicorn | |
| # Initialize app | |
| app = FastAPI(title="OrcaleSeek API", version="1.0.0") | |
| # CORS for web access | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], # Change this to your website domain | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Load model | |
| classifier = pipeline( | |
| "text-classification", | |
| model="your-username/OrcaleSeek", | |
| tokenizer="your-username/OrcaleSeek" | |
| ) | |
| class PredictionRequest(BaseModel): | |
| text: str | |
| max_length: int = 128 | |
| class PredictionResponse(BaseModel): | |
| prediction: list | |
| status: str | |
| model: str = "OrcaleSeek" | |
| def home(): | |
| return {"message": "OrcaleSeek API is running! 🚀"} | |
| def health_check(): | |
| return {"status": "healthy"} | |
| async def predict(request: PredictionRequest): | |
| try: | |
| result = classifier(request.text) | |
| return PredictionResponse( | |
| prediction=result, | |
| status="success" | |
| ) | |
| except Exception as e: | |
| return PredictionResponse( | |
| prediction=[], | |
| status=f"error: {str(e)}" | |
| ) | |
| # Run with: uvicorn api:app --host 0.0.0.0 --port 8000 --reload | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="0.0.0.0", port=8000) |