Spaces:
Sleeping
Sleeping
updated docs
Browse files- README.md +10 -3
- docs/swagger.png +0 -0
- src/main.py +5 -1
README.md
CHANGED
@@ -14,14 +14,21 @@ This app provides endpoints to showcase fine-tuning of models for image and text
|
|
14 |
It is possible to execute one training at a time and to get status information via the `/get_training_status` endpoint.
|
15 |
Via the `/stop_training` endpoint stopping the currently running training is possible. After the training, the fine-tuned model is uploaded to huggingface hub.
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
## Neccesary Environment Variables
|
18 |
- `AUTHENTICATION_TOKEN`: Secret that is necessary to authorize calling the apps endpoints.
|
|
|
19 |
- `HUGGINGFACE_TOKEN`: Huggingface token to be used for accessing the huggingface hub and uploading the models.
|
20 |
- `HUGGINGFACE_ORGANIZATION`: Organization to be used for uploading the fine-tuned models.
|
21 |
|
22 |
-
Further details for parameters of the endpoints see: https://your-domain/docs
|
23 |
-
|
24 |
-
|
25 |
## Image Classification
|
26 |
|
27 |
Use `/training/image_classification` for fine tuning a model for image classification tasks.
|
|
|
14 |
It is possible to execute one training at a time and to get status information via the `/get_training_status` endpoint.
|
15 |
Via the `/stop_training` endpoint stopping the currently running training is possible. After the training, the fine-tuned model is uploaded to huggingface hub.
|
16 |
|
17 |
+
![Swagger UI](./docs/swagger.png)
|
18 |
+
|
19 |
+
Further details for parameters of the endpoints see: https://your-domain/docs
|
20 |
+
|
21 |
+
## Deployments
|
22 |
+
This app can be deployed on hugging face spaces or run on any docker environment. Regardless on the infrastructure, it is recommended to use GPUs for executing the trainings.
|
23 |
+
- Hugging face spaces: Duplicate the space and run it on a GPU.
|
24 |
+
- Docker environments: Use the docker-compose file in the repository to run the app locally.
|
25 |
+
|
26 |
## Neccesary Environment Variables
|
27 |
- `AUTHENTICATION_TOKEN`: Secret that is necessary to authorize calling the apps endpoints.
|
28 |
+
When running as private hugging face space, this needs to be the same as a hugging face token.
|
29 |
- `HUGGINGFACE_TOKEN`: Huggingface token to be used for accessing the huggingface hub and uploading the models.
|
30 |
- `HUGGINGFACE_ORGANIZATION`: Organization to be used for uploading the fine-tuned models.
|
31 |
|
|
|
|
|
|
|
32 |
## Image Classification
|
33 |
|
34 |
Use `/training/image_classification` for fine tuning a model for image classification tasks.
|
docs/swagger.png
ADDED
src/main.py
CHANGED
@@ -23,7 +23,11 @@ from pathlib import Path
|
|
23 |
import tempfile
|
24 |
|
25 |
|
26 |
-
app = FastAPI(
|
|
|
|
|
|
|
|
|
27 |
|
28 |
environmentVariableChecker = EnvironmentVariableChecker()
|
29 |
environmentVariableChecker.validate_environment_variables()
|
|
|
23 |
import tempfile
|
24 |
|
25 |
|
26 |
+
app = FastAPI(
|
27 |
+
title="Pimcore Fine-Tuning Service",
|
28 |
+
description="This service allows you to fine-tune image and text classification models and upload them to hugging face hub.",
|
29 |
+
version="1.0.0"
|
30 |
+
)
|
31 |
|
32 |
environmentVariableChecker = EnvironmentVariableChecker()
|
33 |
environmentVariableChecker.validate_environment_variables()
|