Sirclavin commited on
Commit
01b108c
1 Parent(s): d4ee564

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +115 -1
README.md CHANGED
@@ -4,4 +4,118 @@ language:
4
  - en
5
  tags:
6
  - 'autotrain '
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - en
5
  tags:
6
  - 'autotrain '
7
+ ---
8
+ ---
9
+ tags:
10
+ - autotrain
11
+ - text-generation
12
+ widget:
13
+ - text: Once upon a time,
14
+ - text: My name is john and my hobby is
15
+ - text: My hobby was playing cricket but now i
16
+ - text: I asked my biology teacher that
17
+ - text: I love playing
18
+ - text: I came back to home to pet my cat but then
19
+ - text: I never received a letter from John Lewis after he
20
+ license: apache-2.0
21
+ language:
22
+ - en
23
+ ---
24
+
25
+
26
+
27
+
28
+ # NeXGen - A Text Generative Model
29
+ Note- this is the large version of NeXGen series we,ll realise larger versions of NeXGen soon stay-tuned.
30
+
31
+ Based version of NeXGen at: [CrabfishAI/NeXGen-based](https://huggingface.co/CrabfishAI/NeXGen-based)
32
+
33
+ Introduction-NeXGen is a state-of-the-art text generative model designed to meet diverse needs, from creative writing to content creation. This model leverages advanced natural language processing techniques to provide human-like text generation with a wide range of applications.
34
+
35
+ ## Features
36
+
37
+ - **Creative Content Generation:** NeXGen excels at generating creative writing, including stories, poetry, and fictional narratives.
38
+ - **Contextual Awareness:** The model understands context, ensuring coherent and contextually appropriate responses.
39
+ - **User-Friendly Interface:** NeXGen offers an intuitive and user-friendly interface for seamless integration into various applications.
40
+ - **Versatility:** From content creation to educational support, NeXGen adapts to different writing styles and applications.
41
+ - **Advanced Architecture:** Built on the latest advancements in natural language processing, NeXGen offers high-quality text generation.
42
+
43
+ ## Uses
44
+
45
+ NeXGen finds application in various domains, including:
46
+
47
+ - **Content Creation:** Generate marketing copy, stories, and product descriptions.
48
+ - **Assistance in Writing:** Aid authors, bloggers, and students in drafting articles and essays.
49
+ - **Chatbot Development:** Power conversational agents with human-like responses.
50
+ - **Prototyping and Idea Generation:** Facilitate brainstorming sessions for product development.
51
+ - **Social Media Content:** Generate engaging captions for social media posts.
52
+ - **Personal Assistant Applications:** Assist users in drafting emails and messages.
53
+
54
+ ## Direct Use Cases
55
+
56
+ NeXGen can be directly employed for:
57
+
58
+ - **Automated Email Drafting:** Quickly compose emails with NeXGen's assistance.
59
+ - **Blog Post Generation:** Generate sections or entire articles based on a given topic.
60
+ - **Code Commenting:** Improve code documentation with clear and concise comments.
61
+ - **Storyline Creation for Games:** Create dynamic and engaging storylines for video games.
62
+ - **Learning Material Generation:** Develop study guides and educational content.
63
+ - **Personal Journaling Assistance:** Receive prompts and suggestions for journaling.
64
+
65
+ ## Getting Started
66
+
67
+ To download NeXGen use this code:
68
+ ```python
69
+ from transformers import AutoTokenizer, AutoModelForCausalLM
70
+
71
+ # Specify the model name from Hugging Face Model Hub
72
+ model_name = "CrabfishAI/NeXGen-large"
73
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
74
+ model = AutoModelForCausalLM.from_pretrained(model_name)
75
+
76
+ def generate_text(prompt, max_length=100, num_beams=5, no_repeat_ngram_size=2, top_k=50, top_p=0.95, temperature=0.7):
77
+ input_ids = tokenizer.encode(prompt, return_tensors="pt")
78
+
79
+ # Ensure attention_mask is provided
80
+ attention_mask = input_ids.ne(tokenizer.pad_token_id).float()
81
+
82
+ # Generate output text
83
+ output = model.generate(
84
+ input_ids,
85
+ max_length=max_length,
86
+ num_beams=num_beams,
87
+ no_repeat_ngram_size=no_repeat_ngram_size,
88
+ top_k=top_k,
89
+ top_p=top_p,
90
+ temperature=temperature,
91
+ attention_mask=attention_mask # Pass attention_mask to the generation method
92
+ )
93
+
94
+ decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
95
+ return decoded_output
96
+
97
+ # Example usage:
98
+ prompt = "Your prompt here"
99
+ generated_text = generate_text(prompt, max_length=200)
100
+
101
+ print("Generated Text:")
102
+ print(generated_text)
103
+ ```
104
+
105
+ ## Limitation
106
+
107
+ 1. **Content Quality**: The model's output may vary in quality, and there's a possibility it might generate content that is nonsensical, irrelevant, or grammatically incorrect.
108
+
109
+ 2. **Bias and Sensitivity**: The model is trained on diverse data, but it may inadvertently exhibit biases or generate content that is sensitive or inappropriate. Exercise caution and review generated text before use.
110
+
111
+ 3. **Inappropriate Language**: The model might generate text that includes offensive language or inappropriate content. Be mindful of this, especially in applications where maintaining a respectful and inclusive tone is essential.
112
+
113
+ 4. **Ambiguous Prompts**: The quality of generated text is highly dependent on the prompt provided. Ambiguous or unclear prompts may result in less coherent or relevant outputs.
114
+
115
+ ## Disclaimer
116
+
117
+ - **Use with Caution**: This model is a tool that should be used with caution. Always review and validate the generated text before incorporating it into any application or publication.
118
+
119
+ - **Not for Critical Applications**: Avoid using the model for critical applications where accuracy and reliability are paramount. The model is intended for creative and exploratory purposes.
120
+
121
+ - **Ongoing Improvement**: The model may be updated or fine-tuned for better performance. Stay informed about updates and consider using the latest version for improved results.