Python Transformer

Open-source Python projects categorized as Transformer

Top 23 Python Transformer Projects

  • transformers

    🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.

    Project mention: Fine-Tuned Llama2 Inserting Unnecessary Delimiters | /r/LocalLLaMA | 2023-11-04

    While its tough to say something specifc since we dont know how exactly you trained it or the prompt format of your training input or how you are performing inference, one thing I found when I faced similar types of issues is that the model does not know when to stop. Some of it is because the fast llama tokenizer does not add the token when encoding your inputs. So you can either add that token explicitly in your input text for each sample or use the slow llama tokenizer. Check llama_recipes github repo for the exact issue The other most probable thing you might want to check is if the model.generate output contains the exact input tokens too. That is the expected behavior of some models (like llama2 or mpt) for example when you use vanilla transformers for inference.

  • mmdetection

    OpenMMLab Detection Toolbox and Benchmark

    Project mention: Semantic segementation | /r/computervision | 2023-04-12

    When I look for benchmarks I always start here it has the lists of datasets to measure models accross lots o papers. Many are very specific models with low support or community but it gives you a good idea of ​​the state of the art. It also lists repositories related to good community. seems very active and the one that is being used the most, you could use the models that it has integrated in its model zoo, within the same repository. It has the benchmarks to compare those same models and some of them are from 2022

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • best-of-ml-python

    🏆 A ranked list of awesome machine learning Python libraries. Updated weekly.

    Project mention: Ask HN: How to get back into AI? | | 2022-12-10

    For Python, here's a nice compilation:

  • vllm

    A high-throughput and memory-efficient inference and serving engine for LLMs

    Project mention: OpenAI Delays | | 2023-12-01

    Heh, so it totally depends on the use case.

    I use GPT4 constantly to chat through issues I am working on and get different perspectives. I cannot do that with local models.

    On the other hand, I have been processing a ton of text transcripts with a fine tuned llama2 13b model i've been working on, and for the tasks I have fine-tuned on, my local model is producing better results than GPT4, often taking a task that I had to do in multiple steps with GPT4, and being able to complete it in a single shot.

    I can run my local model through vLLM on my workstation at around the same tokens/sec as I can spend maxing out my API limits with GPT3.5-turbo (~$20/hr) while running on 2x 3090's. I'm hitting the vLLM (OpenAI clone) chat/completions endpoint. My model implements the HF chat_templates feature, and I worked on adding support for that to vLLM: (llama.cpp is talking about adding support for it too) so I could easily swap out my model in my data pipeline in place of GPT3.5/GPT4, and I wouldn't have to keep maintaining that code on my side.

    So, with these transcripts I've been:


    RWKV is an RNN with transformer-level LLM performance. It can be directly trained like a GPT (parallelizable). So it's combining the best of RNN and transformer - great performance, fast inference, saves VRAM, fast training, "infinite" ctx_len, and free sentence embedding.

    Project mention: Understanding Deep Learning | | 2023-11-26

    That is not true. There are RNNs with transformer/LLM-like performance. See

  • PaddleSpeech

    Easy-to-use Speech Toolkit including Self-Supervised Learning model, SOTA/Streaming ASR with punctuation, Streaming TTS with text frontend, Speaker Verification System, End-to-End Speech Translation and Keyword Spotting. Won NAACL2022 Best Demo Award.

    Project mention: Open Source Libraries | /r/AudioAI | 2023-10-02


  • trax

    Trax — Deep Learning with Clear Code and Speed

    Project mention: Replit's new Code LLM was trained in 1 week | | 2023-05-03

    and the implementation if you are interested.

    Hope you get to look into this!

  • Onboard AI

    Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at

  • PaddleSeg

    Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, 3D Segmentation, etc.

    Project mention: [Medical Segmentation] The all-in-one 3D medical image segmentation toolkit. From data annotation to model deployment, you are welcome to try it all! | /r/ArtificialInteligence | 2022-12-19


  • LaTeX-OCR

    pix2tex: Using a ViT to convert images of equations into LaTeX code.

    Project mention: Detexify LaTeX Handwriting Symbol Recognition | | 2023-11-14
  • LMFlow

    An Extensible Toolkit for Finetuning and Inference of Large Foundation Models. Large Models for All.

    Project mention: Your weekly machine learning digest | /r/learnmachinelearning | 2023-07-03
  • jukebox

    Code for the paper "Jukebox: A Generative Model for Music"

    Project mention: Open Source Libraries | /r/AudioAI | 2023-10-02

    openai/jukebox: Music Generation

  • GPT2-Chinese

    Chinese version of GPT2 training code, using BERT tokenizer.

  • mmsegmentation

    OpenMMLab Semantic Segmentation Toolbox and Benchmark.

    Project mention: [D] The MMSegmentation library from OpenMMLab appears to return the wrong results when computing basic image segmentation metrics such as the Jaccard index (IoU - intersection-over-union). It appears to compute recall (sensitivity) instead of IoU, which artificially inflates the performance metrics. | /r/MachineLearning | 2023-03-06
  • bertviz

    BertViz: Visualize Attention in NLP Models (BERT, GPT2, BART, etc.)

    Project mention: Show HN: Fully client-side GPT2 prediction visualizer | | 2023-09-05

    It would be interesting to have attention visualized as well, similar to how it's done in BertViz:

  • faster-whisper

    Faster Whisper transcription with CTranslate2

    Project mention: Distil-Whisper: distilled version of Whisper that is 6 times faster, 49% smaller | | 2023-10-31

    That's the implication. If the distil models are same format as original openai models then the Distil models can be converted for faster-whisper use as per the conversion instructions on

    So then we'll see whether we get the 6x model speedup on top of the stated 4x faster-whisper code speedup.

  • BERT-pytorch

    Google AI 2018 BERT pytorch implementation

  • Informer2020

    The GitHub repository for the paper "Informer" accepted by AAAI 2021.

  • OpenPrompt

    An Open-Source Framework for Prompt-Learning.

  • SwinIR

    SwinIR: Image Restoration Using Swin Transformer (official repository)

    Project mention: Certain directories (e.g. SwinIR) are empty (version: Empire Media Science A1111 Web UI Installer) | /r/StableDiffusion | 2023-03-17
  • Efficient-AI-Backbones

    Efficient AI Backbones including GhostNet, TNT and MLP, developed by Huawei Noah's Ark Lab.

  • manga-image-translator

    Translate manga/image 一键翻译各类图片内文字

    Project mention: [DISC] - The angel who came to pick me up is a Gal (Oneshot by Shiraishi Kouhei) | /r/manga | 2023-09-06

    OCR works pretty good., and are all pretty nice.

  • HRNet-Semantic-Segmentation

    The OCR approach is rephrased as Segmentation Transformer: This is an official implementation of semantic segmentation for HRNet.

  • towhee

    Towhee is a framework that is dedicated to making neural data processing pipelines simple and fast.

    Project mention: FLaNK Stack Weekly for 14 Aug 2023 | | 2023-08-14
  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-12-01.

Python Transformer related posts


What are some of the best open-source Transformer projects in Python? This list will help you:

Project Stars
1 transformers 116,187
2 mmdetection 26,197
3 best-of-ml-python 14,691
4 vllm 10,443
5 RWKV-LM 10,351
6 PaddleSpeech 9,156
7 trax 7,809
8 PaddleSeg 7,803
9 LaTeX-OCR 7,666
10 LMFlow 7,467
11 jukebox 7,297
12 GPT2-Chinese 7,216
13 mmsegmentation 6,773
14 bertviz 5,930
15 faster-whisper 5,814
16 BERT-pytorch 5,785
17 Informer2020 4,401
18 OpenPrompt 3,931
19 SwinIR 3,759
20 Efficient-AI-Backbones 3,584
21 manga-image-translator 2,983
22 HRNet-Semantic-Segmentation 2,976
23 towhee 2,853
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives