Kaludi commited on
Commit
44eb4d0
1 Parent(s): 204ace2

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +29 -0
  2. examples.txt +150 -0
  3. requirements.txt +3 -0
app.py ADDED
@@ -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 ADDED
@@ -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
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ tensorflow
2
+ transformers
3
+ torch