everycure-ner-pdf / README.md
Luis Chaves
first commit
73b49a2
|
raw
history blame
1.52 kB
metadata
title: Everycure Ner Pdf
emoji: 🐢
colorFrom: indigo
colorTo: purple
sdk: docker
pinned: false

local dev

uv run uvicorn app:app --reload --port 8000

if your pdfs are in a folder called pdfs/ run:

curl -v -X POST -F "file=@pdfs/MECFS systematic review.pdf" http://localhost:8000/api/v1/extract

Or use the automatic Swagger documentation at http://localhost:8000/docs

Deploying to HuggingFace Spaces

FROM python:3.9-slim

WORKDIR /code

# Copy only the necessary files
COPY ./app.py /code/
COPY ./extractor.py /code/
COPY ./pyproject.toml /code/
COPY ./openapi.yaml /code/

# Install dependencies
RUN pip install --no-cache-dir "fastapi[all]" python-multipart pydantic

# Run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
  1. Push to HuggingFace:
# Initialize git repository if not already done
git init
git add .
git commit -m "Initial commit"

# Add HuggingFace remote
git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME

# Push to HuggingFace
git push hf main

Note: Replace YOUR_USERNAME and YOUR_SPACE_NAME with your HuggingFace username and the name you chose for your Space.

Important Notes

  • HuggingFace Spaces uses port 7860 by default
  • The API will be available at https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
  • Make sure your model files are included in the repository if needed
  • The free tier of HuggingFace Spaces has limitations on CPU/RAM usage