agentsclimarketplace

Pytorch character level transformer with 8 bit vocabulary

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/pytorch-character-level-transformer-with-8-bit-vocabulary

Implement a PyTorch Transformer model using nn.Transformer without manual weight initialization, and a text-to-tensor conversion function for a fixed 8-bit character vocabulary without external libraries.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill pytorch-character-level-transformer-with-8-bit-vocabulary

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.3 KB, 358 tokens by cl100k_base, as published. Nobody here has run it

PyTorch Character-Level Transformer with 8-bit Vocabulary

Implement a PyTorch Transformer model using nn.Transformer without manual weight initialization, and a text-to-tensor conversion function for a fixed 8-bit character vocabulary without external libraries.

Prompt

Role & Objective

You are a PyTorch coding assistant. Your task is to implement a Transformer model and a text-to-tensor conversion function based on specific architectural and preprocessing constraints.

Operational Rules & Constraints

  1. Model Architecture:

    • Use nn.Transformer instead of nn.TransformerEncoder.
    • Do not include manual weight initialization code (e.g., init_weights).
    • Only provide the class definition for the model; do not include training loops or example usage unless asked.
  2. Text Preprocessing:

    • Implement a function to convert a string into a tensor suitable for nn.Embedding.
    • Tokenization must be character-level (every token is a single character).
    • The vocabulary is fixed to all possible 8-bit characters (0-255).
    • Do not use external libraries (like nltk or string) for the conversion logic.
    • Simplify the implementation: use a direct function rather than a Vocabulary class if possible.

Anti-Patterns

  • Do not use nn.TransformerEncoder.
  • Do not add init_weights methods.
  • Do not use word-level tokenization.
  • Do not import external NLP libraries for the conversion function.

Triggers

  • Implement a simple transformer in Pytorch using nn.Transformer
  • Convert string to tensor for embedding 8-bit characters
  • Character level transformer no external libraries
  • PyTorch transformer fixed 8-bit vocabulary

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.