fine-tuning-service / README.md
fashxp's picture
updated docs
9a7baaa
metadata
title: Fine-Tuning Service
emoji: 🦀
colorFrom: green
colorTo: yellow
sdk: docker
pinned: false
license: other

Pimcore Fine-Tuning Service

This app provides endpoints to showcase fine-tuning of models for image and text classification tasks. It is possible to execute one training at a time and to get status information via the /get_training_status endpoint. Via the /stop_training endpoint stopping the currently running training is possible. After the training, the fine-tuned model is uploaded to huggingface hub.

Swagger UI

Further details for parameters of the endpoints see: https://your-domain/docs

Deployments

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.

  • Hugging face spaces: Duplicate the space and run it on a GPU.
  • Docker environments: Use the docker-compose file in the repository to run the app locally.

Neccesary Environment Variables

  • AUTHENTICATION_TOKEN: Secret that is necessary to authorize calling the apps endpoints. When running as private hugging face space, this needs to be the same as a hugging face token.
  • HUGGINGFACE_TOKEN: Huggingface token to be used for accessing the huggingface hub and uploading the models.
  • HUGGINGFACE_ORGANIZATION: Organization to be used for uploading the fine-tuned models.

Image Classification

Use /training/image_classification for fine tuning a model for image classification tasks.

Important Parameters

  • training_data_zip: The ZIP file containing the training data, with a folder per class which contains images belonging to that class.
  • project_name: The name of the project. Will also be used as name of resulting model that will be created after fine tuning and as the name of the repository at huggingface.
  • source_model_name: The source model to be used as basis for fine tuning.

Text Classification

Use /training/text_classification for fine tuning a model for text classification tasks.

Important Parameters

  • training_data_csv: The CSV file containing the training data, necessary columns value (text data) and target (classification).
  • project_name: The name of the project. Will also be used as name of resulting model that will be created after fine tuning and as the name of the repository at huggingface.
  • source_model_name: The source model to be used as basis for fine tuning.