Luis Chaves commited on
Commit
ef61402
·
1 Parent(s): 73b49a2

removed flat layout for hf

Browse files
Dockerfile CHANGED
@@ -2,14 +2,11 @@ FROM python:3.12-slim
2
 
3
  WORKDIR /code
4
 
5
- # Copy only the necessary files
6
- COPY ./app.py /code/
7
- COPY ./extractor.py /code/
8
  COPY ./pyproject.toml /code/
 
 
9
  COPY ./openapi.yaml /code/
10
 
11
- # Install dependencies
12
  RUN pip install --no-cache-dir .[all]
13
 
14
- # Run the application
15
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /code
4
 
 
 
 
5
  COPY ./pyproject.toml /code/
6
+ COPY ./README.md /code/
7
+ COPY ./src /code/src
8
  COPY ./openapi.yaml /code/
9
 
 
10
  RUN pip install --no-cache-dir .[all]
11
 
12
+ CMD ["python", "-m", "everycure.app"]
 
README.md CHANGED
@@ -20,47 +20,3 @@ curl -v -X POST -F "file=@pdfs/MECFS systematic review.pdf" http://localhost:800
20
  ```
21
 
22
  Or use the automatic Swagger documentation at `http://localhost:8000/docs`
23
-
24
- ## Deploying to HuggingFace Spaces
25
-
26
- ```dockerfile
27
- FROM python:3.9-slim
28
-
29
- WORKDIR /code
30
-
31
- # Copy only the necessary files
32
- COPY ./app.py /code/
33
- COPY ./extractor.py /code/
34
- COPY ./pyproject.toml /code/
35
- COPY ./openapi.yaml /code/
36
-
37
- # Install dependencies
38
- RUN pip install --no-cache-dir "fastapi[all]" python-multipart pydantic
39
-
40
- # Run the application
41
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
42
- ```
43
-
44
- 3. Push to HuggingFace:
45
-
46
- ```bash
47
- # Initialize git repository if not already done
48
- git init
49
- git add .
50
- git commit -m "Initial commit"
51
-
52
- # Add HuggingFace remote
53
- git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
54
-
55
- # Push to HuggingFace
56
- git push hf main
57
- ```
58
-
59
- Note: Replace `YOUR_USERNAME` and `YOUR_SPACE_NAME` with your HuggingFace username and the name you chose for your Space.
60
-
61
- ### Important Notes
62
-
63
- - HuggingFace Spaces uses port 7860 by default
64
- - The API will be available at `https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME`
65
- - Make sure your model files are included in the repository if needed
66
- - The free tier of HuggingFace Spaces has limitations on CPU/RAM usage
 
20
  ```
21
 
22
  Or use the automatic Swagger documentation at `http://localhost:8000/docs`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pyproject.toml CHANGED
@@ -13,3 +13,11 @@ dependencies = [
13
  "python-multipart>=0.0.6", # Required for handling file uploads
14
  "pydantic>=2.5.3"
15
  ]
 
 
 
 
 
 
 
 
 
13
  "python-multipart>=0.0.6", # Required for handling file uploads
14
  "pydantic>=2.5.3"
15
  ]
16
+
17
+ [build-system]
18
+ requires = ["setuptools>=61.0"]
19
+ build-backend = "setuptools.build_meta"
20
+
21
+ [tool.setuptools]
22
+ package-dir = {"" = "src"}
23
+ packages = ["everycure"]
src/everycure/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ """Everycure package for medical entity extraction."""
2
+
3
+ __version__ = "0.1.0"
app.py → src/everycure/app.py RENAMED
File without changes
extractor.py → src/everycure/extractor.py RENAMED
File without changes