Skip to content

Commit 6d68fe8

Browse files
authored
Add files via upload
0 parents  commit 6d68fe8

File tree

5 files changed

+235
-0
lines changed

5 files changed

+235
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
# ChatGPT-BingChat Prompt Generator
3+
4+
Generates ChatGPT/BingChat & GPT-3 prompts using [this](https://huggingface.co/merve/chatgpt-prompts-bart-long) model trained by Merve.
5+
6+
Enter a role and a prompt will be generated based on it.
7+
8+
# Web App
9+
Click [Here](edit "Here") To View This App Online!
10+
11+
![Image](Image)
12+
13+
## Features
14+
15+
- Generate prompts based on a role entered by the user
16+
- Uses a pre-trained language model to generate the prompt
17+
18+
## Usage
19+
20+
To use the app, simply enter a role in the input field and click on the "Generate" button. A prompt will be generated based on the role entered.
21+
22+
## Examples
23+
24+
Some examples of roles that can be entered:
25+
26+
- Virtual Assistant
27+
- Customer Service Representative
28+
- Personal Assistant
29+
- Data Scientist
30+
31+
## Technical details
32+
33+
The app uses Streamlit for the user interface and the Hugging Face Transformers library to access the pre-trained language model. The model is a seq2seq language model trained using the BART architecture.
34+
35+
## Requirements
36+
37+
- Python 3.6 or higher
38+
- Streamlit
39+
- Transformers (Hugging Face)
40+
41+
## Installation
42+
43+
1. Clone the repository:
44+
45+
`git clone https://github.com/Kaludii/ChatGPT-BingChat-Prompt-Generator.git`
46+
47+
2. Install the required packages:
48+
49+
`pip install streamlit transformers`
50+
51+
3. Run the app:
52+
53+
`streamlit run app.py`

app.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import streamlit as st
2+
import random
3+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
4+
5+
tokenizer = AutoTokenizer.from_pretrained("merve/chatgpt-prompts-bart-long")
6+
model = AutoModelForSeq2SeqLM.from_pretrained("merve/chatgpt-prompts-bart-long", from_tf=True)
7+
8+
def generate(prompt):
9+
batch = tokenizer(prompt, return_tensors="pt")
10+
generated_ids = model.generate(batch["input_ids"], max_new_tokens=150)
11+
output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
12+
return output[0]
13+
14+
st.title("ChatGPT-BingChat Prompt Generator")
15+
st.write("This app generates ChatGPT/BingChat & GPT-3 prompts using [this](https://huggingface.co/merve/chatgpt-prompts-bart-long) model trained by Merve. Enter a role and a prompt will be generated based on it.")
16+
prompt = st.text_input("Enter a Role, Example: Virtual Assistant", placeholder="Text here", value="")
17+
if st.button("Generate"):
18+
output = generate(prompt)
19+
st.write("Generated Prompt:", box=True)
20+
st.write("<div style='background-color: #2E2E2E; padding: 10px;'>{}</div>".format(output), unsafe_allow_html=True)
21+
st.write("")
22+
st.write("<div style='text-align: center; font-weight: bold;'>Examples:</div>",unsafe_allow_html=True, box=True)
23+
st.write("<style> .stBox span { background-color: #2E2E2E; } </style>", unsafe_allow_html=True)
24+
with open("examples.txt", "r") as f:
25+
examples = f.readlines()
26+
random_examples = random.sample(examples, 5)
27+
for example in random_examples:
28+
example = example.strip()
29+
st.write("<div style='background-color: #2E2E2E; padding: 10px; text-align: center;'>• {}</div>".format(example), unsafe_allow_html=True)

examples.txt

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
Personal Finance Advisor
2+
Health and Wellness Coach
3+
Social Media Strategist
4+
Personal Shopper
5+
Resume Builder
6+
Language Tutor
7+
Virtual Assistant
8+
Graphic Designer
9+
SEO Analyst
10+
Web Developer
11+
IT Support Specialist
12+
Data Analyst
13+
Project Manager
14+
Human Resources Manager
15+
Business Consultant
16+
Marketing Manager
17+
Sales Representative
18+
Customer Service Representative
19+
Content Creator
20+
Photographer
21+
Film Director
22+
Musician
23+
Artist
24+
Chef
25+
Gardener
26+
Fitness Trainer
27+
Personal Trainer
28+
Therapist
29+
Life Coach
30+
Lawyer
31+
Accountant
32+
Economist
33+
Scientist
34+
Engineer
35+
Teacher
36+
Librarian
37+
Journalist
38+
Writer
39+
Historian
40+
Geographer
41+
Anthropologist
42+
Sociologist
43+
Psychologist
44+
Philosopher
45+
Theologian
46+
Archeologist
47+
Astronomer
48+
Biologist
49+
Zoologist
50+
Ecologist
51+
Event Planner
52+
Interior Designer
53+
Landscape Architect
54+
Real Estate Agent
55+
Home Inspector
56+
Mechanic
57+
Electrician
58+
Plumber
59+
Carpenter
60+
Roofer
61+
HVAC Technician
62+
Cleaner
63+
Nanny
64+
Pet Sitter
65+
Dog Walker
66+
Veterinarian
67+
Pharmacist
68+
Nurse
69+
Doctor
70+
Surgeon
71+
Dentist
72+
Optometrist
73+
Physical Therapist
74+
Massage Therapist
75+
Chiropractor
76+
Acupuncturist
77+
Naturopathic Doctor
78+
Psychologist
79+
Psychiatrist
80+
Social Worker
81+
Probation Officer
82+
Police Officer
83+
Firefighter
84+
Paramedic
85+
Emergency Medical Technician
86+
Military Service Member
87+
Diplomat
88+
Politician
89+
Activist
90+
Environmentalist
91+
Human Rights Advocate
92+
Animal Rights Activist
93+
Community Organizer
94+
Religious Leader
95+
Spiritual Advisor
96+
Yoga Instructor
97+
Meditation Teacher
98+
Personal Growth Coach
99+
Creativity Coach
100+
Executive Coach
101+
Wealth Manager
102+
Stock Broker
103+
Financial Planner
104+
Investment Banker
105+
Real Estate Developer
106+
Entrepreneur
107+
CEO
108+
CFO
109+
COO
110+
HR Manager
111+
Operations Manager
112+
Supply Chain Manager
113+
Marketing Director
114+
Product Manager
115+
Sales Manager
116+
Business Development Manager
117+
Software Developer
118+
Mobile App Developer
119+
Cloud Engineer
120+
Cybersecurity Specialist
121+
Database Administrator
122+
Network Engineer
123+
IT Manager
124+
Technical Writer
125+
UX Designer
126+
UI Designer
127+
Web Designer
128+
Game Developer
129+
Animator
130+
3D Modeler
131+
Film Editor
132+
Sound Designer
133+
Music Producer
134+
DJ
135+
Stand-up Comedian
136+
Improviser
137+
Magician
138+
Illusionist
139+
Circus Performer
140+
Dancer
141+
Choreographer
142+
Theater Director
143+
Playwright
144+
Screenwriter
145+
Film Critic
146+
Book Reviewer
147+
Food Critic
148+
Art Critic
149+
Fashion Critic
150+
Music Critic

images/ChatGPT-Prompt-Gen.png

35.6 KB
Loading

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tensorflow
2+
transformers
3+
torch

0 commit comments

Comments
 (0)