/ Модель

Характеристики

Контекст
2 048 токенов
Лицензия
MIT
Архитектура
gpt2 · dense
Библиотека
transformers
Опубликована
14 ноя 2024

german-gpt2-medium

Генерация текстаТекст → текст3 профессии

Предобученная немецкоязычная GPT-2 с контекстом 2048 токенов для генерации текста и последующего дообучения.

704скачиваний за 30 дней2лайкавеса обновлены26 ноя 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

kkirchheim/german-gpt2-medium — авторская немецкоязычная версия GPT-2 Medium, разработанная как предобученная базовая языковая модель. Она содержит около 358 млн параметров, использует архитектуру GPT2LMHeadModel и принимает текст для продолжения или генерации на немецком языке. Контекст модели составляет до 2048 токенов; веса опубликованы в форматах PyTorch и Safetensors, а токенизатор взят из stefan-it/german-gpt2-larger.

Модель предназначена для генерации немецкого текста и как основа для дообучения под прикладные задачи. Она обучалась на отфильтрованных текстах немецкого корпуса GC4, собранного из Common Crawl, включая газетные и государственные материалы; сведения в модели актуальны примерно до 2020 года. Модель может воспроизводить предубеждения обучающих данных, выдавать оскорбительный или фактически неверный текст и не имеет встроенных защитных фильтров. Лицензия — MIT.

Сценарии применения

  • генерация продолжений немецких текстов
  • создание черновиков на немецком языке
  • дообучение модели для немецкоязычной генерации
  • исследования языкового моделирования для немецкого

Ограничения

Обучающие данные отражают предубеждения интернет-корпуса; модель не имеет защитных фильтров и может генерировать оскорбительный или недостоверный текст. Знания ограничены примерно 2020 годом, поэтому модель не подходит для ответов о более поздних событиях без дополнительного источника.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

German GPT-2 Medium (358M Parameters)

This model is a German-only variant of GPT-2 with approximately 358 million parameters and an extended context size of 2048 tokens. It is pre-trained on 300 GB of German text data and is intended as a base model for text generation tasks in German.

  • Version: 1.0 (Initial and likely final release)
  • Model Type: Pre-trained language model
  • Tokenizer: Utilizes the tokenizer from stefan-it/german-gpt2-larger, with the pad_token set to the eos_token.

Training Data

The model is trained on a large-scale German text corpus derived from Common Crawl data, filtered to include high-quality text such as newspapers and government websites.

  • Name: German Colossal Clean Common Crawl (GC4) Corpus (filtered version)
    • This model is trained on all of the HEAD files from the GC4 corpus.
  • Size: Approximately 300 GB of text data.
  • Knowledge Cutoff: 2020

Intended Use

  • Base model for fine-tuning on German text generation tasks.
  • Research in natural language processing for the German language.

Users: NLP researchers, developers, and practitioners focusing on German language applications.

Limitations

  • Biases: The model may reflect biases present in the training data, including stereotypes or offensive content.
  • No Content Filtering: The model lacks guardrails and may generate inappropriate or harmful text.
  • Outdated Information: Contains knowledge up to 2020; does not include events after this date.

Ethical Considerations and Bias

The presented and trained language model is for research purposes only. The GC4 corpus—used for training—contains crawled texts from the internet. Thus, this GPT-2 model can be considered as highly biased, potentially encoding stereotypical associations along gender, race, ethnicity, and disability status. Before using and working with the released checkpoints, it is highly recommended to read:

  • "On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?" by Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell.

Potential Risks:

  • Generation of biased or offensive content.
  • Misrepresentation of factual information.
  • Propagation of stereotypes.

Mitigation Strategies:

  • Implement bias mitigation techniques and content filtering appropriate for your use case.
  • Use the model in controlled settings with human oversight.
  • Perform thorough evaluation before deployment.

How to Use

from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("kkirchheim/german-gpt2-medium")
model = AutoModelForCausalLM.from_pretrained("kkirchheim/german-gpt2-medium")

Pipeline Code Example:

from transformers import pipeline

model_name = "kkirchheim/german-gpt2-medium"

generator = pipeline('text-generation', model=model_name, tokenizer=tokenizer)

prompt = "Der Sinn des Lebens ist"
outputs = generator(prompt, max_length=50, num_return_sequences=1)

print(outputs[0]['generated_text'])

Acknowledgments

  • Funding: Chair of Software and Systems Engineering at the Otto-von-Guericke University of Magdeburg.
  • Contributors: Konstantin Kirchheim
  • Third-Party Resources:

Disclaimer: This model is provided for research purposes only and comes with no warranties. The authors are not responsible for any output generated by the model. Users should exercise caution and are responsible for compliance with applicable laws and regulations.

Changelog:

  • Version 1.0: Initial release.

Future Work:

  • No planned updates or future releases at this time.

Notes:

  • Ethical Use: Users should ensure that the model is used ethically and responsibly, considering potential impacts on individuals and society.
  • Legal Considerations: Users should perform their own due diligence regarding the permissible use of the model and its outputs.

FAQ:

Q: Can I use this model for commercial purposes?

A: The model is intended for research purposes only. Commercial use is not advised without proper legal consultation.

Q: How do I address potential biases in the model's outputs?

A: Implement bias mitigation strategies and content filtering appropriate for your use case. Always review the model's outputs critically.

Training Procedure

Hyperparameters:

  • Optimizer: AdamW (Torch implementation)
  • Learning Rate: 6e-4
  • Batch Size:
    • Per Device Train Batch Size: 12
    • Gradient Accumulation Steps: 12
    • Effective Batch Size: 144 (12 * 12)
  • Number of Epochs: 1 (single pass over the dataset)
  • Warmup Steps: 1,000
  • Weight Decay: 0.1
  • Mixed Precision Training: Enabled (fp16=True)
  • Gradient Checkpointing: Enabled
  • Evaluation Strategy:
    • Evaluation Steps: Every 100 steps
    • Per Device Evaluation Batch Size: 12
  • Logging:
    • Logging Steps: Every 10 steps
    • Logging to: TensorBoard

Training Hardware:

  • Compute Resources: 4 NVIDIA A100 GPUs with 40 GB memory each.
  • Training Duration: Approximately 1.5 months.
  • Parallelism: Distributed Data Parallel (DDP)

Additional Training Details:

  • Resume from Checkpoint: Enabled (resume_from_checkpoint=True)
  • Optimizer Settings:
    • Used adamw_torch optimizer.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
GPT2LMHeadModel
Ревизия весов
6f04bd4

0 моделей