edukom/Serbian-GPT-2
The Best Generative GPT-2 Model For The Serbian Language
NOTE: This model is locked with a key, if you need decryption keys, feel free to contact us at info@edukom.rs

By sharing this model, we aim to foster further research and applications in Serbian language processing.
Introduction:
This GPT-2 model has been tuned on an extensive Serbian corpus, boasting a richness of 750 million tokens. It is designed to generate high-quality text in Serbian, capturing the nuances and intricacies of the language.
Dataset Details:
The dataset encompasses a diverse range of topics, representing various aspects of the Serbian language and culture. Size: 750 million tokens.
Model Usage:
This model can be utilized for various NLP tasks such as text generation, summarization, translation, and more. Due to its comprehensive training on a vast corpus, it promises accurate and contextually relevant outputs, especially for tasks related to the Serbian language.
Download & Decryption the Model:
import os import requests import shutil import threading import time from transformers import GPT2LMHeadModel from cryptography.fernet import Fernet
os.environ['TFCPPMINLOGLEVEL'] = '3'
# Download Serbian-GPT-2 model print("\nDownload Serbian-GPT-2 model...") modelname = 'edukom/Serbian-GPT-2' baseurl = f'https://huggingface.co/{modelname}/resolve/main/' filestodownload = ['addedtokens.json', 'config.json', 'generationconfig.json', 'merges.txt', 'pytorchmodel.bin', 'specialtokensmap.json', 'tokenizer.json', 'tokenizer_config.json', 'vocab.json']
cache_dir = 'path/to/where/you/want/to/store/the/model'
for file in filestodownload: response = requests.get(baseurl + file) with open(os.path.join(cachedir, file), 'wb') as f: f.write(response.content)
# Decryption pytorchmodel.bin key = input("\nEnter the decryption key: ").encode() ciphersuite = Fernet(key)
decryptiondata = os.path.join(cachedir, 'pytorch_model.bin')
try: with open(decryptiondata, 'rb') as file: encrypteddata = file.read()
decrypteddata = ciphersuite.decrypt(encrypted_data)
with open(decryptiondata, 'wb') as file: file.write(decrypteddata)
def findandcopy(): basesnapshotdir = os.path.join(cache_dir, 'models--edukom--Serbian-GPT-2', 'snapshots')
while not os.path.exists(basesnapshotdir): time.sleep(0.1)
while True: existingdirs = [d for d in os.listdir(basesnapshotdir) if os.path.isdir(os.path.join(basesnapshotdir, d))] if existingdirs: destinationpath = os.path.join(basesnapshotdir, existingdirs[0], 'pytorchmodel.bin') shutil.copyfile(decryptiondata, destination_path) break time.sleep(0.1)
# Start the copy process in parallel copythread = threading.Thread(target=findandcopy, name="findandcopy") copythread.start()
# Loading Serbian-GPT-2 model model = GPT2LMHeadModel.frompretrained(modelname, cachedir=cachedir)
# Ensure the copying finishes copy_thread.join()
print("\nCongratulations, the Serbian-GPT-2 model is ready for use ヅ\n")
except Exception as e: print(f"\nError during decryption: {e}") print("\nYou can decrypt the model by contacting the author of this model who will add the key, email: info@edukom.rs")
# Now you can use the Serbian-GPT-2 model for further operations...
Model Usage License:
The author of this model is the company Edukom AI. The model is protected by encryption and its use requires a decryption key.
This model is available under the following license:
For private and non-public use: This model is freely available for use without any additional obligations. You can use it in your internal projects and experiments without any restrictions.
For commercial use: For commercial use of this model, users are required to contact Edukom AI company to obtain the appropriate license and agreement.
Please adhere to the license terms when using this model. For any questions or if you need decryption keys, feel free to contact us at info@edukom.rs
Thank you for using our model! ヅ

