%global _empty_manifest_terminate_build 0
Name: python-classy-core
Version: 0.3.2
Release: 1
Summary: A powerful tool to train and use your classification models.
License: Apache
URL: https://github.com/sunglasses-ai/classy
Source0: https://mirrors.aliyun.com/pypi/web/packages/75/77/91c3da44ec76507b72abba7261164d69ddb2b5558c37e632e4c27400f51f/classy-core-0.3.2.tar.gz
BuildArch: noarch
Requires: python3-torch
Requires: python3-pytorch-lightning
Requires: python3-torchmetrics
Requires: python3-transformers
Requires: python3-hydra-core
Requires: python3-argcomplete
Requires: python3-wandb
Requires: python3-datasets
Requires: python3-nltk
Requires: python3-seqeval
Requires: python3-rouge-score
Requires: python3-sacrebleu
Requires: python3-rich
Requires: python3-sentencepiece
Requires: python3-plotly
Requires: python3-pdoc3
Requires: python3-st-annotated-text
Requires: python3-streamlit
Requires: python3-fastapi
Requires: python3-uvicorn[standard]
Requires: python3-streamlit
Requires: python3-st-annotated-text
Requires: python3-plotly
Requires: python3-streamlit
Requires: python3-st-annotated-text
Requires: python3-pdoc3
Requires: python3-fastapi
Requires: python3-pdoc3
Requires: python3-plotly
Requires: python3-fastapi
Requires: python3-uvicorn[standard]
Requires: python3-st-annotated-text
Requires: python3-streamlit
Requires: python3-uvicorn[standard]
%description
A PyTorch-based library for fast prototyping and sharing of deep neural network models.
## Quick Links
- [↗️ Website](http://sunglasses-ai.github.io/classy/)
- [📓 Documentation](http://sunglasses-ai.github.io/classy/docs/intro)
- [💻 Template](https://github.com/sunglasses-ai/classy-template)
- [🔦 Examples](https://github.com/sunglasses-ai/classy-examples)
- [✋ Contributing Guidelines](CONTRIBUTING.md)
- [🌙 Nightly Releases](https://pypi.org/project/classy-core/#history)
## In this README
- [🚀 Getting Started](#getting-started-using-classy)
- [⚡ Installation](#installation)
- [⌨ Running Classy](#running-classy)
- [`classy train`](#classy-train)
- [`classy predict`](#classy-predict)
- [`classy evaluate`](#classy-evaluate)
- [`classy serve`](#classy-serve)
- [`classy demo`](#classy-demo)
- [`classy describe`](#classy-describe)
- [`classy upload`](#classy-upload)
- [`classy download`](#classy-download)
- [Enable `classy` shell completion](#enabling-shell-completion)
- [🤔 Issues](#issues)
- [❤️ Contributions](#contributions)
## Getting Started using classy
If this is your first time meeting `classy`, don't worry! We have plenty of resources to help you learn how it works and what it can do for you.
For starters, have a look at our [amazing website](http://sunglasses-ai.github.io/classy) and [our documentation](http://sunglasses-ai.github.io/classy/docs/intro)!
If you want to get your hands dirty right away, have a look at our [base classy template](https://github.com/sunglasses-ai/classy-template).
Also, we have [a few examples](https://github.com/sunglasses-ai/classy-examples) that you can look at to get to know `classy`!
## Installation
*For a more in-depth installation guide (covering also installing from source and through docker), please visit our [installation page](https://sunglasses-ai.github.io/classy/docs/installation/).*
If you are using one of our [templates](https://github.com/sunglasses-ai/classy-template), there is a handy `setup.sh` script you can use that will execute the commands to create the environment and install `classy` for you.
### Installing via pip
#### Setting up a virtual environment
We strongly recommend using [Conda](https://conda.io/) as the environment manager when dealing with deep learning / data science / machine learning. It's also recommended that you install the PyTorch ecosystem **before** installing `classy` by following the instructions on [pytorch.org](https://pytorch.org/)
If you already have a Python 3 environment you want to use, you can skip to the [Installing the library and dependencies](#Installing-the-library-and-dependencies) section.
1. [Download and install Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html).
2. Create a Conda environment with Python 3.8+:
```yaml
conda create -n classy python=3.8
```
3. Activate the Conda environment:
```yaml
conda activate classy
```
#### Installing the library and dependencies
Simply execute
```yaml
pip install classy-core
```
and voilà! You're all set.
*Looking for some adventures? Install nightly releases directly from [pypi](https://pypi.org/project/classy-core/#history)! You will ~~not~~ regret it :)*
## Running `classy`
Once it is installed, `classy` is available as a command line tool. It offers a wide variety of subcommands, all listed below. Detailed guides and references for each command is available [in the documentation](https://sunglasses-ai.github.io/classy/docs/reference-manual/cli/train/).
Every one of `classy`'s subcommands have a `-h|--help` flag available which details the various arguments & options you can use (e.g., `classy train -h`).
### `classy train`
In its simplest form, `classy train` lets you train a transformer-based neural network for one of the tasks supported by `classy` (see [the documentation](https://sunglasses-ai.github.io/classy/docs/reference-manual/tasks-and-formats/)).
```yaml
classy train sentence-pair path/to/dataset/folder-or-file -n my-model
```
The command above will train a model to predict a label given a pair of sentences as input (e.g., Natural Language Inference or NLI) and save it under `experiments/my-model`. This same model can be further used by all other `classy` commands which require a `classy` model (`predict`, `evaluate`, `serve`, `demo`, `upload`).
### `classy predict`
`classy predict` actually has two subcommands: `interactive` and `file`.
The first loads the model in memory and lets you try it out through the shell directly, so that you can test the model you trained and see what it predicts given some input. It is particularly useful when your machine cannot open a port for [`classy demo`](#classy-demo).
The second, instead, works on a file and produces an output where, for each input, it associates the corresponding predicted label. It is very useful when doing pre-processing or when you need to evaluate your model (although we offer [`classy evaluate`](#classy-evaluate) for that).
### `classy evaluate`
`classy evaluate` lets you evaluate your model on standard metrics for the task your model was trained upon. Simply run `classy evaluate my-model path/to/file -o path/to/output/file` and it will dump the evaluation at `path/to/output/file`
### `classy serve`
`classy serve ` loads the model in memory and spawns a REST API you can use to query your model with any REST client.
### `classy demo`
`classy demo ` spawns a [Streamlit](https://streamlit.io) interface which lets you quickly show and query your model.
### `classy describe`
`classy describe --dataset path/to/dataset` runs some common metrics on a file formatted for the specific task. Great tool to run **before** training your model!
### `classy upload`
`classy upload ` lets you upload your `classy`-trained model on the [HuggingFace Hub](https://huggingface.co) and lets other users download / use it. (NOTE: you need a HuggingFace Hub account in order to upload to their hub)
Models uploaded via `classy upload` will be available for download by other classy users by simply executing `classy download username@model`.
### `classy download`
`classy download ` downloads a previously uploaded `classy`-trained model from the [HuggingFace Hub](https://huggingface.co) and stores it on your machine so that it is usable with any other `classy` command which requires a trained model (`predict`, `evaluate`, `serve`, `demo`, `upload`).
Models uploaded via `classy upload` are available by doing `classy download username@model`.
### Enabling Shell Completion
To install shell completion, **activate your conda environment** and then execute
```yaml
classy --install-autocomplete
```
From now on, whenever you activate your conda environment with `classy` installed, you are going to have autocompletion when pressing `[TAB]`!
## Issues
You are more than welcome to file issues with either feature requests, bug reports, or general questions. If you already found a solution to your problem, don't hesitate to share it. Suggestions for new best practices and tricks are always welcome!
## Contributions
We warmly welcome contributions from the community. If it is your first time as a contributor, we recommend you start by reading our CONTRIBUTING.md guide.
Small contributions can be made directly in a pull request. For contributing major features, we recommend you first create a issue proposing a design, so that it can be discussed before you risk wasting time.
Pull requests (PRs) must have one approving review and no requested changes before they are merged.
As `classy` is primarily driven by SunglassesAI, we reserve the right to reject or revert contributions that we don't think are good additions or might not fit into our roadmap.
%package -n python3-classy-core
Summary: A powerful tool to train and use your classification models.
Provides: python-classy-core
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-classy-core
A PyTorch-based library for fast prototyping and sharing of deep neural network models.
## Quick Links
- [↗️ Website](http://sunglasses-ai.github.io/classy/)
- [📓 Documentation](http://sunglasses-ai.github.io/classy/docs/intro)
- [💻 Template](https://github.com/sunglasses-ai/classy-template)
- [🔦 Examples](https://github.com/sunglasses-ai/classy-examples)
- [✋ Contributing Guidelines](CONTRIBUTING.md)
- [🌙 Nightly Releases](https://pypi.org/project/classy-core/#history)
## In this README
- [🚀 Getting Started](#getting-started-using-classy)
- [⚡ Installation](#installation)
- [⌨ Running Classy](#running-classy)
- [`classy train`](#classy-train)
- [`classy predict`](#classy-predict)
- [`classy evaluate`](#classy-evaluate)
- [`classy serve`](#classy-serve)
- [`classy demo`](#classy-demo)
- [`classy describe`](#classy-describe)
- [`classy upload`](#classy-upload)
- [`classy download`](#classy-download)
- [Enable `classy` shell completion](#enabling-shell-completion)
- [🤔 Issues](#issues)
- [❤️ Contributions](#contributions)
## Getting Started using classy
If this is your first time meeting `classy`, don't worry! We have plenty of resources to help you learn how it works and what it can do for you.
For starters, have a look at our [amazing website](http://sunglasses-ai.github.io/classy) and [our documentation](http://sunglasses-ai.github.io/classy/docs/intro)!
If you want to get your hands dirty right away, have a look at our [base classy template](https://github.com/sunglasses-ai/classy-template).
Also, we have [a few examples](https://github.com/sunglasses-ai/classy-examples) that you can look at to get to know `classy`!
## Installation
*For a more in-depth installation guide (covering also installing from source and through docker), please visit our [installation page](https://sunglasses-ai.github.io/classy/docs/installation/).*
If you are using one of our [templates](https://github.com/sunglasses-ai/classy-template), there is a handy `setup.sh` script you can use that will execute the commands to create the environment and install `classy` for you.
### Installing via pip
#### Setting up a virtual environment
We strongly recommend using [Conda](https://conda.io/) as the environment manager when dealing with deep learning / data science / machine learning. It's also recommended that you install the PyTorch ecosystem **before** installing `classy` by following the instructions on [pytorch.org](https://pytorch.org/)
If you already have a Python 3 environment you want to use, you can skip to the [Installing the library and dependencies](#Installing-the-library-and-dependencies) section.
1. [Download and install Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html).
2. Create a Conda environment with Python 3.8+:
```yaml
conda create -n classy python=3.8
```
3. Activate the Conda environment:
```yaml
conda activate classy
```
#### Installing the library and dependencies
Simply execute
```yaml
pip install classy-core
```
and voilà! You're all set.
*Looking for some adventures? Install nightly releases directly from [pypi](https://pypi.org/project/classy-core/#history)! You will ~~not~~ regret it :)*
## Running `classy`
Once it is installed, `classy` is available as a command line tool. It offers a wide variety of subcommands, all listed below. Detailed guides and references for each command is available [in the documentation](https://sunglasses-ai.github.io/classy/docs/reference-manual/cli/train/).
Every one of `classy`'s subcommands have a `-h|--help` flag available which details the various arguments & options you can use (e.g., `classy train -h`).
### `classy train`
In its simplest form, `classy train` lets you train a transformer-based neural network for one of the tasks supported by `classy` (see [the documentation](https://sunglasses-ai.github.io/classy/docs/reference-manual/tasks-and-formats/)).
```yaml
classy train sentence-pair path/to/dataset/folder-or-file -n my-model
```
The command above will train a model to predict a label given a pair of sentences as input (e.g., Natural Language Inference or NLI) and save it under `experiments/my-model`. This same model can be further used by all other `classy` commands which require a `classy` model (`predict`, `evaluate`, `serve`, `demo`, `upload`).
### `classy predict`
`classy predict` actually has two subcommands: `interactive` and `file`.
The first loads the model in memory and lets you try it out through the shell directly, so that you can test the model you trained and see what it predicts given some input. It is particularly useful when your machine cannot open a port for [`classy demo`](#classy-demo).
The second, instead, works on a file and produces an output where, for each input, it associates the corresponding predicted label. It is very useful when doing pre-processing or when you need to evaluate your model (although we offer [`classy evaluate`](#classy-evaluate) for that).
### `classy evaluate`
`classy evaluate` lets you evaluate your model on standard metrics for the task your model was trained upon. Simply run `classy evaluate my-model path/to/file -o path/to/output/file` and it will dump the evaluation at `path/to/output/file`
### `classy serve`
`classy serve ` loads the model in memory and spawns a REST API you can use to query your model with any REST client.
### `classy demo`
`classy demo ` spawns a [Streamlit](https://streamlit.io) interface which lets you quickly show and query your model.
### `classy describe`
`classy describe --dataset path/to/dataset` runs some common metrics on a file formatted for the specific task. Great tool to run **before** training your model!
### `classy upload`
`classy upload ` lets you upload your `classy`-trained model on the [HuggingFace Hub](https://huggingface.co) and lets other users download / use it. (NOTE: you need a HuggingFace Hub account in order to upload to their hub)
Models uploaded via `classy upload` will be available for download by other classy users by simply executing `classy download username@model`.
### `classy download`
`classy download ` downloads a previously uploaded `classy`-trained model from the [HuggingFace Hub](https://huggingface.co) and stores it on your machine so that it is usable with any other `classy` command which requires a trained model (`predict`, `evaluate`, `serve`, `demo`, `upload`).
Models uploaded via `classy upload` are available by doing `classy download username@model`.
### Enabling Shell Completion
To install shell completion, **activate your conda environment** and then execute
```yaml
classy --install-autocomplete
```
From now on, whenever you activate your conda environment with `classy` installed, you are going to have autocompletion when pressing `[TAB]`!
## Issues
You are more than welcome to file issues with either feature requests, bug reports, or general questions. If you already found a solution to your problem, don't hesitate to share it. Suggestions for new best practices and tricks are always welcome!
## Contributions
We warmly welcome contributions from the community. If it is your first time as a contributor, we recommend you start by reading our CONTRIBUTING.md guide.
Small contributions can be made directly in a pull request. For contributing major features, we recommend you first create a issue proposing a design, so that it can be discussed before you risk wasting time.
Pull requests (PRs) must have one approving review and no requested changes before they are merged.
As `classy` is primarily driven by SunglassesAI, we reserve the right to reject or revert contributions that we don't think are good additions or might not fit into our roadmap.
%package help
Summary: Development documents and examples for classy-core
Provides: python3-classy-core-doc
%description help
A PyTorch-based library for fast prototyping and sharing of deep neural network models.
## Quick Links
- [↗️ Website](http://sunglasses-ai.github.io/classy/)
- [📓 Documentation](http://sunglasses-ai.github.io/classy/docs/intro)
- [💻 Template](https://github.com/sunglasses-ai/classy-template)
- [🔦 Examples](https://github.com/sunglasses-ai/classy-examples)
- [✋ Contributing Guidelines](CONTRIBUTING.md)
- [🌙 Nightly Releases](https://pypi.org/project/classy-core/#history)
## In this README
- [🚀 Getting Started](#getting-started-using-classy)
- [⚡ Installation](#installation)
- [⌨ Running Classy](#running-classy)
- [`classy train`](#classy-train)
- [`classy predict`](#classy-predict)
- [`classy evaluate`](#classy-evaluate)
- [`classy serve`](#classy-serve)
- [`classy demo`](#classy-demo)
- [`classy describe`](#classy-describe)
- [`classy upload`](#classy-upload)
- [`classy download`](#classy-download)
- [Enable `classy` shell completion](#enabling-shell-completion)
- [🤔 Issues](#issues)
- [❤️ Contributions](#contributions)
## Getting Started using classy
If this is your first time meeting `classy`, don't worry! We have plenty of resources to help you learn how it works and what it can do for you.
For starters, have a look at our [amazing website](http://sunglasses-ai.github.io/classy) and [our documentation](http://sunglasses-ai.github.io/classy/docs/intro)!
If you want to get your hands dirty right away, have a look at our [base classy template](https://github.com/sunglasses-ai/classy-template).
Also, we have [a few examples](https://github.com/sunglasses-ai/classy-examples) that you can look at to get to know `classy`!
## Installation
*For a more in-depth installation guide (covering also installing from source and through docker), please visit our [installation page](https://sunglasses-ai.github.io/classy/docs/installation/).*
If you are using one of our [templates](https://github.com/sunglasses-ai/classy-template), there is a handy `setup.sh` script you can use that will execute the commands to create the environment and install `classy` for you.
### Installing via pip
#### Setting up a virtual environment
We strongly recommend using [Conda](https://conda.io/) as the environment manager when dealing with deep learning / data science / machine learning. It's also recommended that you install the PyTorch ecosystem **before** installing `classy` by following the instructions on [pytorch.org](https://pytorch.org/)
If you already have a Python 3 environment you want to use, you can skip to the [Installing the library and dependencies](#Installing-the-library-and-dependencies) section.
1. [Download and install Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html).
2. Create a Conda environment with Python 3.8+:
```yaml
conda create -n classy python=3.8
```
3. Activate the Conda environment:
```yaml
conda activate classy
```
#### Installing the library and dependencies
Simply execute
```yaml
pip install classy-core
```
and voilà! You're all set.
*Looking for some adventures? Install nightly releases directly from [pypi](https://pypi.org/project/classy-core/#history)! You will ~~not~~ regret it :)*
## Running `classy`
Once it is installed, `classy` is available as a command line tool. It offers a wide variety of subcommands, all listed below. Detailed guides and references for each command is available [in the documentation](https://sunglasses-ai.github.io/classy/docs/reference-manual/cli/train/).
Every one of `classy`'s subcommands have a `-h|--help` flag available which details the various arguments & options you can use (e.g., `classy train -h`).
### `classy train`
In its simplest form, `classy train` lets you train a transformer-based neural network for one of the tasks supported by `classy` (see [the documentation](https://sunglasses-ai.github.io/classy/docs/reference-manual/tasks-and-formats/)).
```yaml
classy train sentence-pair path/to/dataset/folder-or-file -n my-model
```
The command above will train a model to predict a label given a pair of sentences as input (e.g., Natural Language Inference or NLI) and save it under `experiments/my-model`. This same model can be further used by all other `classy` commands which require a `classy` model (`predict`, `evaluate`, `serve`, `demo`, `upload`).
### `classy predict`
`classy predict` actually has two subcommands: `interactive` and `file`.
The first loads the model in memory and lets you try it out through the shell directly, so that you can test the model you trained and see what it predicts given some input. It is particularly useful when your machine cannot open a port for [`classy demo`](#classy-demo).
The second, instead, works on a file and produces an output where, for each input, it associates the corresponding predicted label. It is very useful when doing pre-processing or when you need to evaluate your model (although we offer [`classy evaluate`](#classy-evaluate) for that).
### `classy evaluate`
`classy evaluate` lets you evaluate your model on standard metrics for the task your model was trained upon. Simply run `classy evaluate my-model path/to/file -o path/to/output/file` and it will dump the evaluation at `path/to/output/file`
### `classy serve`
`classy serve ` loads the model in memory and spawns a REST API you can use to query your model with any REST client.
### `classy demo`
`classy demo ` spawns a [Streamlit](https://streamlit.io) interface which lets you quickly show and query your model.
### `classy describe`
`classy describe --dataset path/to/dataset` runs some common metrics on a file formatted for the specific task. Great tool to run **before** training your model!
### `classy upload`
`classy upload ` lets you upload your `classy`-trained model on the [HuggingFace Hub](https://huggingface.co) and lets other users download / use it. (NOTE: you need a HuggingFace Hub account in order to upload to their hub)
Models uploaded via `classy upload` will be available for download by other classy users by simply executing `classy download username@model`.
### `classy download`
`classy download ` downloads a previously uploaded `classy`-trained model from the [HuggingFace Hub](https://huggingface.co) and stores it on your machine so that it is usable with any other `classy` command which requires a trained model (`predict`, `evaluate`, `serve`, `demo`, `upload`).
Models uploaded via `classy upload` are available by doing `classy download username@model`.
### Enabling Shell Completion
To install shell completion, **activate your conda environment** and then execute
```yaml
classy --install-autocomplete
```
From now on, whenever you activate your conda environment with `classy` installed, you are going to have autocompletion when pressing `[TAB]`!
## Issues
You are more than welcome to file issues with either feature requests, bug reports, or general questions. If you already found a solution to your problem, don't hesitate to share it. Suggestions for new best practices and tricks are always welcome!
## Contributions
We warmly welcome contributions from the community. If it is your first time as a contributor, we recommend you start by reading our CONTRIBUTING.md guide.
Small contributions can be made directly in a pull request. For contributing major features, we recommend you first create a issue proposing a design, so that it can be discussed before you risk wasting time.
Pull requests (PRs) must have one approving review and no requested changes before they are merged.
As `classy` is primarily driven by SunglassesAI, we reserve the right to reject or revert contributions that we don't think are good additions or might not fit into our roadmap.
%prep
%autosetup -n classy-core-0.3.2
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-classy-core -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot - 0.3.2-1
- Package Spec generated