Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Integrating the Best of TF into PyTorch, for Machine Learning, Natural Language Processing, and Text Generation. This is part of the CASL project: http://casl-project.ai/
| Date | Stars |
|---|---|
| 2026-07-31 | 746 |
| 2026-08-04 | 746 |
| 2026-08-06 | 746 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<div align="center">
<img src="./docs/_static/img/logo_h_035.png"><br><br>
</div>
-----------------
[](https://pypi.python.org/pypi/texar-pytorch)
[](https://github.com/asyml/texar-pytorch/actions/workflows/main.yml)
[](https://codecov.io/gh/asyml/texar-pytorch)
[](https://texar-pytorch.readthedocs.io/en/latest/?badge=latest)
[](https://github.com/asyml/texar-pytorch/blob/master/LICENSE)
**Texar-PyTorch** is a toolkit aiming to support a broad set of machine learning, especially natural language processing and text generation tasks. Texar provides a library of easy-to-use ML modules and functionalities for composing whatever models and algorithms. The tool is designed for both researchers and practitioners for fast prototyping and experimentation. Texar-PyTorch was originally developed and is
actively contributed by [Petuum](https://petuum.com/) and [CMU](https://www.cmu.edu/) in collaboration with other institutes.
A mirror of this repository is maintained by [Petuum Open Source](https://github.com/petuum).
Texar-PyTorch integrates many of the best features of TensorFlow into PyTorch, delivering highly usable and customizable modules superior to PyTorch native ones.
### Key Features
* **Two Versions, (Mostly) Same Interfaces**. Texar-PyTorch (this repo) and **[Texar-TF](https://github.com/asyml/texar)** have mostly the same interfaces. Both further combine the best design of TF and PyTorch:
- Interfaces and variable sharing in *PyTorch convention*
- Excellent factorization and rich functionalities in *TF convention*.
* **Versatile** to support broad needs:
- data processing, model architectures, loss functions, training and inference algorithms, evaluation, ...
- encoder(s) to decoder(s), sequential- and self-attentions, memory, hierarchical models, classifiers, ...
- maximum likelihood learning, reinforcement learning, adversarial learning, probabilistic modeling, ...
* **Fully Customizable** at multiple abstraction level -- both novice-friendly and expert-friendly.
- Free to plug in whatever external modules, since Texar is fully compatible with the native PyTorch APIs.
* **Modularized** for maximal re-use and clean APIs, based on principled decomposition of *Learning-Inference-Model Architecture*.
* **Rich Pre-trained Models, Rich Usage with Uniform Interfaces**. BERT, GPT2, XLNet, etc, for encoding, classification, generation, and composing complex models with other Texar components!
* Clean, detailed [documentation](https://texar-pytorch.readthedocs.io) and rich [examples](./examples).
<div align="center">
<img src="./docs/_static/img/texar_stack.png"><br><br>
</div>
<div align="center">
<img src="./docs/_static/img/texar_modules_big.png"><br><br>
</div>
### Library API Example
A code example that builds and trains a **Conditional GPT2** model (e.g., for machine translation and text summarization):
```python
import texar.torch as tx
from texar.torch.run import *
# (1) Modeling
class ConditionalGPT2Model(nn.Module):
"""An encoder-decoder model with GPT-2 as the decoder."""
def __init__(self, vocab_size):
super().__init__()
# Use hyperparameter dict for model configuration
self.embedder = tx.modules.WordEmbedder(vocab_size, hparams=emb_hparams)
self.encoder = tx.modules.TransformerEncoder(hparams=enc_hparams)
self.decoder = tx.modules.GPT2Decoder("gpt2-small") # With pre-trained weights
def _get_decoder_output(self, batch, train=True):
"""Perform model inference, i.e., decoding."""
enc_states = self.encoder(inputs=self.embedder(batch['source_text_ids']),Excerpt of 7,898 characters
Read on GitHub169
Hector · Carnegie Mellon University · United States
38
33
24
17
9
7
4
4
3
2
2
2
1
1
1
1
1
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:8f741193cf648f1f, topic:natural-language-processing, topic:machine-translation, desc:natural language processing
matched fp:8f741193cf648f1f, topic:deep-learning, topic:pytorch