suayptalha / minGRULM-base

huggingface.co
Total runs: 5
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: December 28 2024
text-generation

Introduction of minGRULM-base

Model Details of minGRULM-base

MinGRU Sentiment Analysis

minGRU

First Hugging Face integration of minGRU models from the paper " Were RNNs All We Needed? ".

This model uses GPT-2 tokenizer and trained on roneneldan/TinyStories dataset.

Note: This is an experimental model. Don't forget to train model before usage!

Make sure you have installed " minGRU-pytorch " library by running "pip install minGRU-pytorch".

For modeling and configuration codes: minGRU-hf

Training:

Training code:

def train_model(model, tokenizer, train_data, output_dir, epochs=3, batch_size=16, learning_rate=5e-5, block_size=128):
    train_dataset = TinyStoriesDataset(train_data, tokenizer, block_size)
    train_loader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)

    optimizer = torch.optim.AdamW(model.parameters(), lr=learning_rate)
    scheduler = get_scheduler("linear", optimizer=optimizer, num_warmup_steps=0, num_training_steps=len(train_loader) * epochs)

    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    model.to(device)

    model.train()
    for epoch in range(epochs):
        print(f"Epoch {epoch + 1}/{epochs}")
        epoch_loss = 0
        progress_bar = tqdm(train_loader, desc="Training")
        for batch in progress_bar:
            batch = batch.to(device)

            outputs = model(batch, labels=batch)
            loss = outputs.loss

            optimizer.zero_grad()
            loss.backward()
            optimizer.step()
            scheduler.step()

            epoch_loss += loss.item()
            progress_bar.set_postfix(loss=loss.item())

        print(f"Epoch {epoch + 1} Loss: {epoch_loss / len(train_loader)}")

    model.save_pretrained(output_dir, safe_serialization = False)
    tokenizer.save_pretrained(output_dir)

You can use this code snippet for fine-tuning!

Credits:

https://arxiv.org/abs/2410.01201

I am thankful to Leo Feng, Frederick Tung, Mohamed Osama Ahmed, Yoshua Bengio and Hossein Hajimirsadeghi for their papers.

Buy Me A Coffee

Runs of suayptalha minGRULM-base on huggingface.co

5
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About minGRULM-base huggingface.co Model

More minGRULM-base license Visit here:

https://choosealicense.com/licenses/apache-2.0

minGRULM-base huggingface.co

minGRULM-base huggingface.co is an AI model on huggingface.co that provides minGRULM-base's model effect (), which can be used instantly with this suayptalha minGRULM-base model. huggingface.co supports a free trial of the minGRULM-base model, and also provides paid use of the minGRULM-base. Support call minGRULM-base model through api, including Node.js, Python, http.

suayptalha minGRULM-base online free

minGRULM-base huggingface.co is an online trial and call api platform, which integrates minGRULM-base's modeling effects, including api services, and provides a free online trial of minGRULM-base, you can try minGRULM-base online for free by clicking the link below.

suayptalha minGRULM-base online free url in huggingface.co:

https://huggingface.co/suayptalha/minGRULM-base

minGRULM-base install

minGRULM-base is an open source model from GitHub that offers a free installation service, and any user can find minGRULM-base on GitHub to install. At the same time, huggingface.co provides the effect of minGRULM-base install, users can directly use minGRULM-base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

minGRULM-base install url in huggingface.co:

https://huggingface.co/suayptalha/minGRULM-base

Url of minGRULM-base

minGRULM-base huggingface.co Url

Provider of minGRULM-base huggingface.co

suayptalha
ORGANIZATIONS

Other API from suayptalha

huggingface.co

Total runs: 71
Run Growth: 0
Growth Rate: 0.00%
Updated:June 28 2025
huggingface.co

Total runs: 23
Run Growth: 0
Growth Rate: 0.00%
Updated:December 27 2024
huggingface.co

Total runs: 14
Run Growth: -9
Growth Rate: -64.29%
Updated:January 15 2025
huggingface.co

Total runs: 8
Run Growth: 0
Growth Rate: 0.00%
Updated:December 19 2024
huggingface.co

Total runs: 6
Run Growth: 1
Growth Rate: 16.67%
Updated:October 18 2024
huggingface.co

Total runs: 2
Run Growth: 0
Growth Rate: 0.00%
Updated:December 12 2024