A Poetry plugin for dynamically extracting the package version.

Overview

Poetry Version Plugin

Test Publish Coverage Package version

A Poetry plugin for dynamically extracting the package version.

It can read the version from a file __init__.py with:

# __init__.py

__version__ = "0.1.0"

Alternatively, it can read it from a git tag, set with a GitHub release or with:

$ git tag 0.1.0

🚨 Consider this in the alpha stage. Read the warning below.

When to use

This is useful mainly if you are building a package library for others to use and you want to set the version in a place different than pyproject.toml, but you still want to keep a single source of truth.

It won't be helpful in other use cases like managing local app environments with Poetry.

How to use

Make sure you have Poetry version 1.2.0a1 or above. Read below for instructions to install it if you haven't.

Install Poetry Version Plugin

Install this plugin to your Poetry:

$ poetry plugin add poetry-version-plugin

--> 100%

Set version in init file

Set your package version in your file __init__.py, for example:

from .main import do_awesome_stuff, AwesomeClass

__version__ = "0.2.3"

And then edit your pyproject.toml with a section containing:

[tool.poetry-version-plugin]
source = "init"

Next, build your project. It will show an output like:

$ poetry build
Using __init__.py file at my_awesome_package/__init__.py for dynamic version
Setting package dynamic version to __version__ variable from __init__.py: 0.1.9
Building my-awesome-package (0.1.9)
  - Building sdist
  - Built my-awesome-package-0.1.9.tar.gz
  - Building wheel
  - Built my-awesome-package-0.1.9-py3-none-any.whl

Set the version in a Git tag

Alternatively, to extract the version to use from a Git tag, add a section:

[tool.poetry-version-plugin]
source = "git-tag"

Then create a git tag, for example:

$ git tag 0.1.3

In this case, when building your project, it will show an output like:

$ poetry build
Git tag found, setting dynamic version to: 0.1.3
Building my-awesome-package (0.1.3)
  - Building sdist
  - Built my-awesome-package-0.1.3.tar.gz
  - Building wheel
  - Built my-awesome-package-0.1.3-py3-none-any.whl

Version in pyproject.toml

Currently (2021-05-24) Poetry requires a version configuration in the pyproject.toml, even if you use this plugin.

When using this plugin, that version config won't be used, but Poetry still requires it to be present in the pyproject.toml.

To make it more evident that you are not using that version you can set it to 0.

[tool.poetry]
name = "my-awesome-package"
version = "0"

That way, you will more easily notice if the plugin is not installed, as it will show that you are building a package with version 0 instead of the dynamic version set.

An example pyproject.toml

A short, minimal example pyproject.toml could look like:

"] readme = "README.md" [tool.poetry.dependencies] python = "^3.6" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry-version-plugin] source = "init" ">
[tool.poetry]
name = "my-awesome-package"
version = "0"
description = ""
authors = ["Rick Sanchez "]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.6"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry-version-plugin]
source = "init"

Why

By default, Poetry expects you to set your package version in pyproject.toml. And that would work in most cases.

But imagine you want to expose the version of your package in a __version__ variable so that your users can do things like:

import my_awesome_package
print(my_awesome_package.__version__)

You could manually write the __version__ variable and handle the synchronization between it and the pyproject.toml yourself, which is very error-prone.

The current official way of doing it without duplicating the value is with importlib.metadata.

But that module is only available in Python 3.8 and above. So, for Python 3.7 and 3.6 you have to install a backport as a dependency of your package:

[tool.poetry.dependencies]
importlib-metadata = {version = "^1.0", python = "<3.8"}

But then, when they release each new version of the backport (currently 4.0.1), you have to update it (or not). And your users would have to manually handle conflicts with any other packages that also depend on importlib-metadata which could be multiple, as many packages could be doing the same trick (I've dealt with that).

The other option is not to pin any version range of your importlib-metadata in your pyproject.toml and hope for the best.

And then your __init__.py would have to include code using it, like:

# I don't want this extra complexity 😔
# And it doesn't work in Docker 🐋
try:
    import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
    import importlib_metadata

__version__ = importlib_metadata.version(__name__)

But that code is extra complexity and logic needed in your code, in each of your packages.

🚨 Additionally, this only works when your package is installed in a Python environment. It won't work if, for example, you simply put your code in a container, which is common for web apps and distributed systems.

How this plugin solves it

With this plugin, your package doesn't depend on importlib-metadata, so your users won't need to handle conflicts or extra dependencies.

Instead, your build system (Poetry) is what needs to have this plugin installed.

That avoids the extra code complexity on your side, dependency conflicts for your users, and support for other use cases like code copied directly inside a container.

Version from Git tag

Alternatively, this plugin can also extract the version from a Git tag.

So, you could only create each version in a Git tag (for example, a GitHub release) instead of writing it in code.

And then build the package on Continuous Integration (e.g. GitHub Actions). And this plugin would get the version of the package from that Git tag.

Install Poetry 1.2.0a1

For this plugin to work, you need Poetry version 1.2.0a1 or above.

Poetry 1.2.0a1 was released recently.

There's a high chance you already have installed Poetry 1.1.x.

The first step is to uninstall it:

$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -O
--> 100%

$ python get-poetry.py --uninstall
--> 100%

And then install the new Poetry with the new installer:

$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -O
--> 100%

$ python install-poetry.py --preview
--> 100%

🔍 Notice that the new installer file is named install-poetry.py instead of get-poetry.py. Also, notice that, currently, you need to set --preview for it to install the alpha version 1.2.0a1.

You can check that it worked with:

$ poetry --version
Poetry (version 1.2.0a1)

Support for version in init file

When using a __version__ variable in your __init__.py you can have more logic in that file, import modules, and do more things above and below the declaration of that variable.

But the value has to be a literal string, like:

___version___ = "0.2.0"

...instead of calling a function or something similar.

And the variable has to be at the top-level, so it can't be inside an if statement or similar.

This is all fine and supported in your __init__.py:

# __init__.py

# This is all valid 👍✅

from .main import do_awesome_stuff, AwesomeClass

awesome = AwesomeClass()

# Some comment explaining why this is commented out
# __version__ = "1.0.0"

__version__ = "0.2.3"

if __name__ == "__main__":
    awesome.run()

This example is all valid and supported, and it includes:

  • Imports
  • Other objects and variables
  • Comments
  • The same string __version__ inside a comment
  • If blocks around

But this is not supported:

# 🚨 Not supported

if 2 == 2:
    __version__ = "0.1.0

And this is not supported:

# 🚨 Not supported

def get_version():
    return "0.2.0"

__version__ = get_version()

How the plugin works

Poetry runs the plugin when building a package, and it sets the version right before creating the "package distributable" (e.g., the wheel).

How the version variable works

If you have a package (a single package) declared in the packages config in your pyproject.toml, the plugin will use that package's __init__.py to find the __version__ variable.

If you don't have any packages config, the plugin will assume that you have a single package named as your project, but in the module version (changing - for _). So, if your package is my-awesome-project, the plugin will use the file at my_awesome_project/__init__.py to find the __version__ variable.

This file structure is the default if you create a new project with the command poetry new, so it should work as expected. ✨

The way the plugin works internally is by parsing the __init__.py file. Reading the Python's "Abstract Syntax Tree" using the ast standard module and extracting the literal value of the string. So, it doesn't execute the code in __init__.py, it only reads it as Python code.

The plugin doesn't try to import and execute that __init__.py file because that could require extra computation, external dependencies, etc. And it doesn't try to extract the __version__ with regular expressions, as that would be prone to errors if, for example, there was some other __version__ somewhere in the code, in a comment or inside a string.

Warning

🚨 Consider this in the alpha stage. Poetry 1.2.0a1 with support for plugins was released on 2021-05-21. I started writing this plugin 3 days later, on 2021-05-24.

Things might break in Poetry or in this plugin. So, please try it and test it very carefully before fully adopting it for delicate systems.

The way it works might change, and the specific configuration might change.

Also, if you don't find the following sections intuitive:

[tool.poetry-version-plugin]
source = "init"

and

[tool.poetry-version-plugin]
source = "git-tag"

let me know what alternative configuration would make more sense and be more intuitive to you.

👍 The good news is, assuming you are building packages to then upload them to PyPI for your users to download and use them, the worst that could happen if something broke is that you wouldn't be able to build a new version until something is fixed or changed. But your users shouldn't be affected in any way.

Release Notes

Latest Changes

  • ✏️ Fix typos and rewording in README.md. PR #8 by @Gl0deanR.

0.1.3

  • ✨ Improve logs, prefix with plugin name. PR #6 by @tiangolo.
  • 🔧 Update pyproject metadata. PR #5 by @tiangolo.
  • ✅ Fix coverage. PR #4 by @tiangolo.
  • 📝 Improve docs. PR #3 by @tiangolo.
  • 🐛 Fix tests for CI. PR #1 by @tiangolo.
  • 👷 Fix Latest Changes action, set branch to main. PR #2 by @tiangolo.

License

This project is licensed under the terms of the MIT license.

Issues
  • ✏️ Fix typos and rewording in README.md

    ✏️ Fix typos and rewording in README.md

    Helped with a little text correction.

    opened by Gl0deanR 3
  • Update the version resource when using poetry version

    Update the version resource when using poetry version

    Hi! Thanks for the plugin. It can solve real inconsistencies when using poetry for packages. I think you should consider adding support for altering the version using the poetry version minor/patch/major. I don't mind sending a PR if you see this suggestion fitting.

    answered 
    opened by aviramha 2
  • 🐛 Fix tests for CI

    🐛 Fix tests for CI

    🐛 Fix tests for CI:

    • Separate linting from tests, run only on 3.7+
    • Fix setup for testing git tags
    opened by tiangolo 1
  • 👷 Fix Latest Changes action, set branch to main

    👷 Fix Latest Changes action, set branch to main

    👷 Fix Latest Changes action, set branch to main

    opened by tiangolo 1
  • 📝 Improve docs

    📝 Improve docs

    📝 Improve docs

    opened by tiangolo 1
  • ✅ Fix coverage

    ✅ Fix coverage

    ✅ Fix coverage

    The line reported as not covered is actually a false negative, ref: https://github.com/nedbat/coveragepy/issues/198

    opened by tiangolo 1
  • 🔧 Update pyproject metadata

    🔧 Update pyproject metadata

    🔧 Update pyproject metadata

    opened by tiangolo 1
  • ✨ Improve logs, prefix with plugin name

    ✨ Improve logs, prefix with plugin name

    ✨ Improve logs

    opened by tiangolo 1
  • This plugin is no longer available today!

    This plugin is no longer available today!

    The github actions that were working fine until yesterday are no longer available.

    I get the following error when loading this plugin.

    Run poetry plugin add poetry-version-plugin
    Using version ^0.1.3 for poetry-version-plugin
    Updating dependencies
    Resolving dependencies...
    
      AttributeError
    
      can't set attribute
    
      at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/packages/dependency_package.py:38 in __setattr__
           34│     def __setattr__(self, key: str, value: Any) -> None:
           35│         if key in {"_dependency", "_package"}:
           36│             return super().__setattr__(key, value)
           37│ 
        →  38│         setattr(self._package, key, value)
           39│ 
           40│     def __str__(self) -> str:
           41│         return str(self._package)
           42│ 
    Error: Process completed with exit code 1.
    

    We have confirmed that this error also occurs in the following minimal case dockerfile.

    FROM python:3.6
    
    RUN apt-get update
    RUN apt-get install curl -y
    
    RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -O
    
    RUN python install-poetry.py --preview --version 1.2.0a1
    ENV PATH /root/.local/bin:$PATH
    RUN poetry --version
    RUN poetry plugin add poetry-version-plugin
    

    This means that this plugin can no longer be installed. Do you know the cause?

    opened by Uno-Takashi 1
  • `__init__.py` detection does not assume the existence of `from` specification of packages

    `__init__.py` detection does not assume the existence of `from` specification of packages

    If the project is organized like

    root
       |- src
       |     |- my_package
       |- pyproject.toml
    

    and pyproject.toml is like

    [tool.poetry]
    ...
    packages = [
        { include = "my_package" from = "src" }
    ]
    ...
    [tool.poetry-version-plugin]
    source = "init"
    

    then, the detection of __init__.py fails.

    It is because, I think, the __init__.py detection logic here does not consider the from value.

    opened by TatsuyaShirakawa 0
  • Commit hash fallback in absence of tag

    Commit hash fallback in absence of tag

    Hi,

    Thanks for this plugin!

    I am aware that this plugin is kind of temporary and may end up merged with poetry-dynamic-versioning (or even built into poetry directly?), so adding all kind of functionality may be premature.

    Still a suggestion: it could be useful to be able to use the commit short hash when no tag is set for the current commit, e.g. as a "git-tag-or-commit" option. Maybe something along these lines: https://gist.github.com/mjj2000/3ee188cc155c26a118b06116ad0ebd1d

    opened by qwenger 0
  • Use verbosity=Verbosity.VERBOSE for io.write_line

    Use verbosity=Verbosity.VERBOSE for io.write_line

    This PR ensures that poetry version -s prints the project version number (and nothing else).

    Shell scripts often use poetry version -s to get the current project version number. However, poetry-version-plugin breaks this idiom by printing out extra log messages:

    $ poetry version -s
    poetry-version-plugin: Using __init__.py file at sgap/__init__.py for dynamic version
    poetry-version-plugin: Setting package dynamic version to __version__ variable from __init__.py: 0.1.0
    0.1.0
    

    After merging this PR:

    • poetry version -s will print just the version number (e.g. 0.1.0)
    • poetry version -s -v will print the extra log messages (since --verbose is specified)

    Closes #12.

    opened by shawwn 0
  • Poetry complains about no git tag during export or lock

    Poetry complains about no git tag during export or lock

    Would it be possible to bypass this git tag check except and only during a build? We only need it during a build right.

    During Dockerfile builds or any other shell commands, it complains about not having a tag for basic poetry commands. It should only complain during a poetry build.

      poetry-version-plugin: No Git tag found, not extracting dynamic version
    
      at /usr/local/lib/python3.8/site-packages/poetry_version_plugin/plugin.py:106 in activate
          102│                     "poetry-version-plugin: No Git tag found, not "
          103│                     "extracting dynamic version"
          104│                 )
          105│                 io.write_error_line(message)
        → 106│                 raise RuntimeError(message)
          107│ 
    
    opened by sl304227-nh 2
  • Consider using Dunamai for Git and other version control systems

    Consider using Dunamai for Git and other version control systems

    Hi! I found your project while looking through some Poetry issues, and I just wanted to suggest possibly using Dunamai for the Git integration. Disclosure: I wrote it for use in another versioning plugin, but I think it would be useful for yours too. It takes care of a lot of annoying edge cases, and it supports other VCSes as well (Mercurial, Darcs, Subversion, Bazaar, and Fossil).

    opened by mtkennerly 1
  • poetry commands fail when commit is not tagged

    poetry commands fail when commit is not tagged

    Hi @tiangolo, many thanks for adding this plugin! I'm currently working on replacing pipenv with poetry and this seems to be the last missing piece.

    When testing your plugin I realized that many poetry commands fail when there is either no git tag set at all or when the current commit is not tagged. Do I misunderstand some step in the intended workflow or is this a bug?

    Below please find the steps required to reproduce the errors. Also other commands, e.g. poetry install fail with the same message.

    # Preparation steps
    poetry new TestPackage
    git init TestPackage
    cd TestPackage
    
    # works
    poetry shell
    exit
    
    # add plugin
    echo \n[tool.poetry-version-plugin]\nsource = \"git-tag\" >> pyproject.toml
    
    # raises: 
    # fatal: No names found, cannot describe anything.
    # poetry-version-plugin: No Git tag found, not extracting dynamic version
    poetry shell
    
    # create a tag
    git add -A
    git commit -a -m "Initial commit"
    git tag 0.0.1
    
    # works
    poetry shell
    exit
    
    # add a new commit without tag
    echo TestPackage > README.md
    git add README.md
    git commit -a -m "add readme"
    
    # raises:
    # fatal: no tag exactly matches '6972216108011dd40616c7e92fbd75ee00f96498'
    # poetry-version-plugin: No Git tag found, not extracting dynamic version
    poetry shell
    
    opened by BayerSe 0
  • Only log informations for commands of interest

    Only log informations for commands of interest

    Hey there ! Thx for this plugin

    Would it be possible to silence the messages ? It's a bit annoying when using poetry commands unrelated to the versioning:

    > poetry env list
    poetry-version-plugin: Using __init__.py file at pylsp_mypy_rnx/__init__.py for dynamic version
    poetry-version-plugin: Setting package dynamic version to __version__ variable from __init__.py: 0.1.0
    pylsp-mypy-rnx-Thao6M6B-py3.9 (Activated)
    
    opened by gjeusel 0
  • Automatically set version in __init__.py

    Automatically set version in __init__.py

    First of all, thank you for this @tiangolo, it's a very convenient plugin to have.

    If this could somehow be extended to work like Versioneer or Miniver, so that it overrides the __version__ variable in __init__.py to dynamically use the git tag during development and then override that with a static string at build time, it would be absolutely perfect. Basically one would never have to manually set the version in __init__.py, just set the git tag.

    If you would be interested in doing this, I wouldn't mind making the PR but I'm not sure about what limitations Poetry plugins have, so don't know if it's even possible.

    opened by mrpgraae 4
  • Git tag names

    Git tag names

    Hello,

    In my current use cases, in don't have a 1.2.3 tag for the version 1.2.3, but a v1.2.3 one.

    Maybe we could add a little configuration for this in the pyproject.toml file ?

    opened by nim65s 0
  • Fixing typo

    Fixing typo

    Added missing closing quote

    opened by sanders41 0
Releases(0.1.3)
Owner
Sebastián Ramírez
Creator of FastAPI and Typer. Dev at @explosion. APIs, Deep Learning/ML, full-stack distributed systems, SQL/NoSQL, Python, Docker, JS, TypeScript, etc
Sebastián Ramírez
:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.

THE PROJECT IS ARCHIVED Forks: https://github.com/orsinium/forks DepHell -- project management for Python. Why it is better than all other tools: Form

DepHell 1.7k Dec 3, 2021
A PDM plugin that packs your packages into a zipapp

pdm-packer A PDM plugin that packs your packages into a zipapp Requirements pdm-packer requires Python >=3.7 Installation If you have installed PDM wi

Frost Ming 10 Sep 23, 2021
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 4.4k Nov 24, 2021
The Python Package Index

Warehouse Warehouse is the software that powers PyPI. See our development roadmap, documentation, and architectural overview. Getting Started You can

Python Packaging Authority 2.8k Nov 26, 2021
The Python package installer

pip - The Python Package Installer pip is the package installer for Python. You can use pip to install packages from the Python Package Index and othe

Python Packaging Authority 7.6k Dec 1, 2021
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 4.4k Nov 26, 2021
The Fast Cross-Platform Package Manager

The Fast Cross-Platform Package Manager part of mamba-org Package Manager mamba Package Server quetz Package Builder boa mamba Mamba is a reimplementa

Mamba 2.5k Dec 3, 2021
Conan - The open-source C/C++ package manager

Conan Decentralized, open-source (MIT), C/C++ package manager. Homepage: https://conan.io/ Github: https://github.com/conan-io/conan Docs: https://doc

Conan.io 5.4k Dec 2, 2021
Package manager based on libdnf and libsolv. Replaces YUM.

Dandified YUM Dandified YUM (DNF) is the next upcoming major version of YUM. It does package management using RPM, libsolv and hawkey libraries. For m

null 923 Nov 28, 2021
A flexible package manager that supports multiple versions, configurations, platforms, and compilers.

Spack Spack is a multi-platform package manager that builds and installs multiple versions and configurations of software. It works on Linux, macOS, a

Spack 2.4k Nov 24, 2021
[DEPRECATED] YUM package manager

⛔ This project is deprecated. Please use DNF, the successor of YUM. YUM Yum is an automatic updater and installer for rpm-based systems. Included prog

null 97 Nov 11, 2021
Easy to use, fast, git sourced based, C/C++ package manager.

Yet Another C/C++ Package Manager Easy to use, fast, git sourced based, C/C++ package manager. Features No need to install a program, just include the

null 28 Nov 28, 2021
The delightful package manager for AppImages

⚡️ Zap The delightful package manager for AppImages Report bug · Request feature Looking for the older Zap v1 (Python) implementation? Head over to v1

Srevin Saju 148 Nov 29, 2021
PokerFace is a Python package for various poker tools.

PokerFace is a Python package for various poker tools. The following features are present in PokerFace... Types for cards and their componen

Juho Kim 4 Sep 25, 2021
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

Joakim Sørensen 27 Nov 16, 2021
Poetry plugin to export the dependencies to various formats

Poetry export plugin This package is a plugin that allows the export of locked packages to various formats. Note: For now, only the requirements.txt f

Poetry 18 Nov 24, 2021
Poetry plugin to bundle projects into various formats

Poetry bundle plugin This package is a plugin that allows the bundling of Poetry projects into various formats. Installation The easiest way to instal

Poetry 19 Nov 25, 2021
Poetry workspace plugin for Python monorepos.

poetry-workspace-plugin Poetry workspace plugin for Python monorepos. Inspired by Yarn Workspaces. Adds a new subcommand group, poetry workspace, whic

Jack Smith 35 Nov 24, 2021
A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv

poetry-exec-plugin A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv Installat

null 19 Oct 18, 2021
🛠️ Plugin to integrate Chuy with Poetry

Archived This is bundled with Chuy since v1.3.0. Poetry Chuy Plugin This plugin integrates Chuy with Poetry. Note: This only works in Poetry 1.2.0 or

Eliaz Bobadilla 4 Sep 24, 2021
Py4J enables Python programs to dynamically access arbitrary Java objects

Py4J Py4J enables Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine. Methods are called as

Barthelemy Dagenais 897 Nov 29, 2021
The official PyTorch code for 'DER: Dynamically Expandable Representation for Class Incremental Learning' accepted by CVPR2021

DER.ClassIL.Pytorch This repo is the official implementation of DER: Dynamically Expandable Representation for Class Incremental Learning (CVPR 2021)

rhyssiyan 52 Nov 30, 2021
Python library which makes it possible to dynamically mask/anonymize data using JSON string or python dict rules in a PySpark environment.

pyspark-anonymizer Python library which makes it possible to dynamically mask/anonymize data using JSON string or python dict rules in a PySpark envir

null 3 Sep 30, 2021
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Swagger 21.2k Nov 26, 2021
Makes dynamically updating your Cloudflare DNS records a bit easier ⏩👍😎

Easy Dynamic Cloudflare DNS Updater Makes dynamically updating your Cloudflare DNS records a bit easier ⏩ ?? ?? If using it as a 'Dynamic DNS' client,

Zac Koch 2 Nov 18, 2021
Exploit for CVE-2017-17562 vulnerability, that allows RCE on GoAhead (< v3.6.5) if the CGI is enabled and a CGI program is dynamically linked.

GoAhead RCE Exploit Exploit for CVE-2017-17562 vulnerability, that allows RCE on GoAhead (< v3.6.5) if the CGI is enabled and a CGI program is dynamic

Francisco Spínola 2 Nov 15, 2021
Using LSTM write Tang poetry

本教程将通过一个示例对LSTM进行介绍。通过搭建训练LSTM网络,我们将训练一个模型来生成唐诗。本文将对该实现进行详尽的解释,并阐明此模型的工作方式和原因。并不需要过多专业知识,但是可能需要新手花一些时间来理解的模型训练的实际情况。为了节省时间,请尽量选择GPU进行训练。

null 56 Dec 1, 2021
Cookiecutter template for FastAPI projects using: Machine Learning, Poetry, Azure Pipelines and Pytests

cookiecutter-fastapi In order to create a template to FastAPI projects. ?? Important To use this project you don't need fork it. Just run cookiecutter

Arthur Henrique 128 Nov 27, 2021