--- license: apache-2.0 language: - en pipeline_tag: text-generation --- # Shakespeare-YQG ![Model Banner](https://files.oaiusercontent.com/file-BoFpZg4azofsBbE5t4zFmW?se=2024-12-08T19%3A09%3A39Z&sp=r&sv=2024-08-04&sr=b&rscc=max-age%3D604800%2C%20immutable%2C%20private&rscd=attachment%3B%20filename%3D9f1050ce-60e9-4fcf-8941-b28744aa6b63.webp&sig=40V7xMvyA8GOwGm68eh0U95l9zkgdBvWIOdLG/9Lm0w%3D) **Creator**: Yahya Muhammad Alnwsany **Model Type**: Text Generation Model **Languages Supported**: English **Intended Use**: Creative writing, text generation, and experimentation --- ## 📜 Overview **Shakespeare-YQG** is a fine-tuned language model crafted to emulate the writing style of William Shakespeare. It generates creative and poetic texts, making it ideal for artistic projects, educational use, and entertaining exploration of Shakespearean language. This model leverages cutting-edge natural language processing techniques to blend the charm of classical literature with modern text generation capabilities. --- ## ✨ Features - **Custom Fine-Tuning**: Inspired by the works of William Shakespeare. - **User-Friendly**: Ready to use with Gradio interface and Hugging Face Spaces. - **Interactive Demo**: Experience text generation live on Hugging Face. --- ## 🚀 Usage Here’s how to use the model in your Python project: ```python from transformers import AutoModelForCausalLM, AutoTokenizer # Load the model and tokenizer tokenizer = AutoTokenizer.from_pretrained("NightPrince/Shakespeare-YQG") model = AutoModelForCausalLM.from_pretrained("NightPrince/Shakespeare-YQG") # Provide an input prompt prompt = "To be or not to be, that is" inputs = tokenizer(prompt, return_tensors="pt") # Generate text outputs = model.generate(inputs["input_ids"], max_length=50) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) # 🌐 Interactive Demo Try the live demo of Shakespeare-YQG here: This demo allows you to generate text interactively using Gradio. You can input your own prompts, adjust parameters, and watch the magic unfold in Shakespearean language! # 📂 Dataset The model was trained on a carefully curated dataset consisting of Shakespeare’s works and similar Elizabethan-style texts. This ensures that the generated outputs stay true to the style and elegance of classical literature.