Spaces:
Sleeping
Sleeping
Niharmahesh
commited on
Upload 10 files
Browse files- IMG_0652.jpg +0 -0
- README.md +1 -12
- animation.json +1 -0
- app.py +207 -0
- categories.json +72 -0
- feedback.txt +1 -0
- pages/About.py +74 -0
- pages/test.py +1 -0
- prompts.json +182 -0
- requirements.txt +11 -0
IMG_0652.jpg
ADDED
README.md
CHANGED
@@ -1,12 +1 @@
|
|
1 |
-
|
2 |
-
title: PrompEasz
|
3 |
-
emoji: 💻
|
4 |
-
colorFrom: gray
|
5 |
-
colorTo: purple
|
6 |
-
sdk: streamlit
|
7 |
-
sdk_version: 1.39.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
# prompteasz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
animation.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"v":"4.10.1","fr":60,"ip":0,"op":115,"w":800,"h":800,"nm":"UsePencil_Preview","ddd":0,"assets":[{"id":"comp_30","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Splash","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":32,"ix":10},"p":{"a":0,"k":[40.504,111.562,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 2","np":1,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":40,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 4","np":1,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":80,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 5","np":1,"cix":2,"ix":3,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":120,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 6","np":1,"cix":2,"ix":4,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":160,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 7","np":1,"cix":2,"ix":5,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":200,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 8","np":1,"cix":2,"ix":6,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":240,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 9","np":1,"cix":2,"ix":7,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":280,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 10","np":1,"cix":2,"ix":8,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0.011,-30.399],[0.011,-1.649]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":320,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":1,"cix":2,"ix":9,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.19],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0p19_1_0p167_0p167"],"t":20,"s":[50.66],"e":[0]},{"t":41}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.19],"y":[1]},"o":{"x":[0.485],"y":[0]},"n":["0p19_1_0p485_0"],"t":20,"s":[56.2],"e":[0.01]},{"t":41}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":10,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.59],"y":[0]},"n":["0p833_0p833_0p59_0"],"t":18,"s":[0],"e":[4.9]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":21,"s":[4.9],"e":[4.9]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":41,"s":[4.9],"e":[0]},{"t":45}],"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":18,"op":46,"st":-9,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Pencil","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":360,"ix":10},"p":{"a":1,"k":[{"i":{"x":0,"y":1},"o":{"x":0.333,"y":0},"n":"0_1_0p333_0","t":5,"s":[64.195,86.27,0],"e":[48.112,104.353,0],"to":[0,0,0],"ti":[0,0,0]},{"t":21}],"ix":2},"a":{"a":0,"k":[64.481,86.342,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0,0,0],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0_1_0p333_0","0_1_0p333_0","0_1_0p333_0"],"t":4,"s":[100,100,100],"e":[0,0,100]},{"t":21}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[3.381,-3.51],[0,0],[5.72,5.33],[0,0],[0,0],[-3.64,-3.509]],"o":[[0,0],[0,0],[-4.68,-4.811],[0,0],[3.381,-3.38],[3.64,3.771]],"v":[[40.627,-29.122],[36.467,-25.091],[33.477,-34.581],[24.116,-37.441],[28.275,-41.473],[40.887,-41.863]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[1.95,2.08],[1.3,-1.43],[0,0],[0,0],[-0.78,-1.04],[0,0],[0,0],[0,0]],"o":[[-2.081,-2.08],[0,0],[0,0],[0,0],[0.91,0.781],[0,0],[0,0],[1.3,-1.431]],"v":[[-4.355,3.51],[-10.465,2.21],[-10.596,2.21],[-12.676,8.581],[-10.726,9.88],[-9.555,11.571],[-3.314,9.621],[-3.186,9.621]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[-3.119,-3.12],[1.82,-2.47],[0,0],[0,0],[0.13,0.13],[0,0],[0,0],[0,0]],"o":[[3.121,3.25],[0,0],[0,0],[0,0],[-0.129,-0.13],[0,0],[0,0],[2.47,-1.82]],"v":[[30.486,-31.462],[32.956,-21.581],[-0.846,12.09],[-17.486,16.77],[-17.747,16.64],[-17.747,16.51],[-12.936,-0.13],[20.605,-33.801]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[82.285,69.572],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":5,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":47,"st":-403,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Matte","parent":2,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":360,"ix":10},"p":{"a":0,"k":[63.981,85.342,0],"ix":2},"a":{"a":0,"k":[64.481,86.342,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,1.667],[1,-0.667],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,-1.667],[-1,0.667],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[106.786,18.405],[25.452,22.738],[21.119,135.738],[143.119,136.405],[140.452,25.071],[132.119,40.071],[83.119,88.071],[59.786,92.738],[64.452,67.405],[104.119,24.738]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 2","np":2,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":10,"st":-403,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Box","tt":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[70.259,109.483,0],"ix":2},"a":{"a":0,"k":[-4.741,34.333,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":1},"o":{"x":1,"y":0},"n":"0p833_1_1_0","t":1,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[26.988,-34.286],[-28.286,-34.221],[-28.214,35.164],[27.059,35.1]],"c":true}],"e":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[27.058,34.939],[-28.215,35.004],[-28.214,35.164],[27.059,35.1]],"c":true}]},{"t":20}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":9.2,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.751],"y":[0.904]},"o":{"x":[0.333],"y":[0]},"n":["0p751_0p904_0p333_0"],"t":1,"s":[0],"e":[15.175]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.576],"y":[0.548]},"n":["0_1_0p576_0p548"],"t":4,"s":[15.175],"e":[50]},{"t":21}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0_1_0p333_0"],"t":1,"s":[100],"e":[50]},{"t":21}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":3,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"tr","p":{"a":0,"k":[-4.167,-0.35],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 2","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":21,"st":-451,"bm":0}]},{"id":"comp_31","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Pencil","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.25],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p25_1_0p333_0"],"t":1,"s":[276.61],"e":[354.81]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.5],"y":[0]},"n":["0_1_0p5_0"],"t":40,"s":[354.81],"e":[360]},{"t":66}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.25,"y":1},"o":{"x":0.333,"y":0},"n":"0p25_1_0p333_0","t":1,"s":[102.264,105.842,0],"e":[38.081,105.342,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0,"y":1},"o":{"x":0.5,"y":0},"n":"0_1_0p5_0","t":40,"s":[38.081,105.342,0],"e":[64.195,86.27,0],"to":[0,0,0],"ti":[0,0,0]},{"t":66}],"ix":2},"a":{"a":0,"k":[64.481,86.342,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0,0,0],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0_1_0p333_0","0_1_0p333_0","0_1_0p333_0"],"t":1,"s":[0,0,100],"e":[100,100,100]},{"i":{"x":[0.25,0.25,0.25],"y":[1,1,1]},"o":{"x":[0.45,0.45,0.45],"y":[0,0,0]},"n":["0p25_1_0p45_0","0p25_1_0p45_0","0p25_1_0p45_0"],"t":26.02,"s":[100,100,100],"e":[100,100,100]},{"i":{"x":[0,0,0],"y":[1,1,1]},"o":{"x":[0.5,0.5,0.5],"y":[0,0,0]},"n":["0_1_0p5_0","0_1_0p5_0","0_1_0p5_0"],"t":40,"s":[100,100,100],"e":[100,100,100]},{"t":66}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[3.381,-3.51],[0,0],[5.72,5.33],[0,0],[0,0],[-3.64,-3.509]],"o":[[0,0],[0,0],[-4.68,-4.811],[0,0],[3.381,-3.38],[3.64,3.771]],"v":[[40.627,-29.122],[36.467,-25.091],[33.477,-34.581],[24.116,-37.441],[28.275,-41.473],[40.887,-41.863]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[1.95,2.08],[1.3,-1.43],[0,0],[0,0],[-0.78,-1.04],[0,0],[0,0],[0,0]],"o":[[-2.081,-2.08],[0,0],[0,0],[0,0],[0.91,0.781],[0,0],[0,0],[1.3,-1.431]],"v":[[-4.355,3.51],[-10.465,2.21],[-10.596,2.21],[-12.676,8.581],[-10.726,9.88],[-9.555,11.571],[-3.314,9.621],[-3.186,9.621]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[-3.119,-3.12],[1.82,-2.47],[0,0],[0,0],[0.13,0.13],[0,0],[0,0],[0,0]],"o":[[3.121,3.25],[0,0],[0,0],[0,0],[-0.129,-0.13],[0,0],[0,0],[2.47,-1.82]],"v":[[30.486,-31.462],[32.956,-21.581],[-0.846,12.09],[-17.486,16.77],[-17.747,16.64],[-17.747,16.51],[-12.936,-0.13],[20.605,-33.801]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[82.285,69.572],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":5,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":68,"st":-160,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Line","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[75,74.4,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-36.983,35.558],[27.5,35.558]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":9.2,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 2","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.25],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p25_1_0p333_0"],"t":1,"s":[100],"e":[0]},{"t":40}],"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":48,"st":-160,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Matte","parent":1,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":360,"ix":10},"p":{"a":0,"k":[63.981,85.342,0],"ix":2},"a":{"a":0,"k":[64.481,86.342,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,1.667],[1,-0.667],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,-1.667],[-1,0.667],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[106.786,18.405],[25.452,22.738],[21.119,135.738],[143.119,136.405],[140.452,25.071],[132.119,40.071],[83.119,88.071],[59.786,92.738],[64.452,67.405],[104.119,24.738]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 2","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":48,"op":68,"st":-160,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Box","tt":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[70.259,109.483,0],"ix":2},"a":{"a":0,"k":[-4.741,34.333,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0,"y":1},"o":{"x":0.167,"y":0},"n":"0_1_0p167_0","t":47,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[27.058,34.939],[-28.215,35.004],[-28.214,35.164],[27.059,35.1]],"c":true}],"e":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[26.988,-34.286],[-28.286,-34.221],[-28.214,35.164],[27.059,35.1]],"c":true}]},{"t":66}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":9.2,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-4.167,-0.35],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 2","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":48,"op":68,"st":-403,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"UsePencil_AnimOff","refId":"comp_30","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2},"a":{"a":0,"k":[75,75,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":150,"h":150,"ip":68,"op":115,"st":68,"bm":0},{"ddd":0,"ind":2,"ty":0,"nm":"UsePencil_AnimOn","refId":"comp_31","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2},"a":{"a":0,"k":[75,75,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":150,"h":150,"ip":0,"op":68,"st":0,"bm":0}]}
|
app.py
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from sentence_transformers import SentenceTransformer
|
3 |
+
import torch
|
4 |
+
import json
|
5 |
+
from streamlit_lottie import st_lottie
|
6 |
+
from notion_client import Client
|
7 |
+
from datetime import datetime
|
8 |
+
|
9 |
+
# Set page config at the very beginning
|
10 |
+
st.set_page_config(page_title="Prompt easz", layout="centered")
|
11 |
+
|
12 |
+
# Initialize Notion client
|
13 |
+
notion = Client(auth=st.secrets["NOTION_API_KEY"])
|
14 |
+
NOTION_DATABASE_ID = "32eca0d459e44cbfb1d29fc32c172b63"
|
15 |
+
|
16 |
+
# Custom CSS to increase text size, beautify the app, and highlight the final message
|
17 |
+
st.markdown("""
|
18 |
+
<style>
|
19 |
+
.big-font {
|
20 |
+
font-size:60px !important;
|
21 |
+
text-align: center;
|
22 |
+
}
|
23 |
+
.slider-label {
|
24 |
+
font-size:25px !important;
|
25 |
+
font-weight: bold;
|
26 |
+
}
|
27 |
+
.small-text {
|
28 |
+
font-size:12px !important;
|
29 |
+
}
|
30 |
+
.medium-text {
|
31 |
+
font-size:16px !important;
|
32 |
+
}
|
33 |
+
.center-text {
|
34 |
+
text-align: center;
|
35 |
+
}
|
36 |
+
.highlight {
|
37 |
+
font-family: 'Courier New', Courier, monospace;
|
38 |
+
background-color: #f0f0f0;
|
39 |
+
padding: 10px;
|
40 |
+
border-radius: 5px;
|
41 |
+
}
|
42 |
+
.stTextInput > div > div > input, .stSelectbox > div > div > select, .stButton > button { font-size: 16px; }
|
43 |
+
.stMarkdown { font-size: 14px; }
|
44 |
+
</style>
|
45 |
+
""", unsafe_allow_html=True)
|
46 |
+
|
47 |
+
@st.cache_resource
|
48 |
+
def load_model():
|
49 |
+
return SentenceTransformer('all-MiniLM-L6-v2')
|
50 |
+
|
51 |
+
@st.cache_data
|
52 |
+
def load_prompts():
|
53 |
+
try:
|
54 |
+
with open('prompts.json', 'r') as file:
|
55 |
+
return json.load(file)
|
56 |
+
except json.JSONDecodeError as e:
|
57 |
+
st.error(f"Error loading prompts.json: {e}")
|
58 |
+
return {}
|
59 |
+
|
60 |
+
@st.cache_data
|
61 |
+
def load_categories():
|
62 |
+
try:
|
63 |
+
with open('categories.json', 'r') as file:
|
64 |
+
return json.load(file)
|
65 |
+
except json.JSONDecodeError as e:
|
66 |
+
st.error(f"Error loading categories.json: {e}")
|
67 |
+
return {}
|
68 |
+
|
69 |
+
def load_lottiefile(filepath: str):
|
70 |
+
with open(filepath, "r") as f:
|
71 |
+
return json.load(f)
|
72 |
+
|
73 |
+
def find_prompt_types(user_input, num_types=3):
|
74 |
+
model = load_model()
|
75 |
+
prompt_types = load_prompts()
|
76 |
+
user_embedding = model.encode(user_input, convert_to_tensor=True)
|
77 |
+
similarities = {}
|
78 |
+
for pt, data in prompt_types.items():
|
79 |
+
all_keywords = " ".join([" ".join(variation["keywords"]) for variation in data])
|
80 |
+
pt_embedding = model.encode(all_keywords, convert_to_tensor=True)
|
81 |
+
similarity = torch.cosine_similarity(user_embedding, pt_embedding, dim=0).item()
|
82 |
+
similarities[pt] = similarity
|
83 |
+
return sorted(similarities, key=similarities.get, reverse=True)[:num_types]
|
84 |
+
|
85 |
+
def generate_prompt(prompt_type, topic, category, complexity, topic2=None, constraint=None):
|
86 |
+
model = load_model()
|
87 |
+
prompt_types = load_prompts()
|
88 |
+
categories_info = load_categories()
|
89 |
+
template = prompt_types[prompt_type][0]["template"]
|
90 |
+
complexity_instructions = {
|
91 |
+
"low": "Use simple language and basic concepts. Avoid technical jargon and provide elementary explanations suitable for beginners.",
|
92 |
+
"medium": "Include more detailed explanations and introduce some field-specific terminology. Provide a balance between depth and accessibility.",
|
93 |
+
"high": "Delve into advanced concepts and use specialized terminology. Assume a high level of prior knowledge and provide in-depth analysis."
|
94 |
+
}
|
95 |
+
category_info = categories_info.get(category, {})
|
96 |
+
analogy = category_info.get("analogy", "analogous")
|
97 |
+
expert_role = category_info.get("expert_role", "an expert")
|
98 |
+
related_topics = ", ".join(category_info.get("related_topics", []))
|
99 |
+
return f"""
|
100 |
+
# {prompt_type} Prompt: {topic} in {category}
|
101 |
+
|
102 |
+
{template.format(topic=topic, category=category, topic2=topic2, constraint=constraint)}
|
103 |
+
|
104 |
+
**Complexity: {complexity.capitalize()}**
|
105 |
+
{complexity_instructions[complexity]}
|
106 |
+
|
107 |
+
**Category Details:**
|
108 |
+
- **Analogy:** {analogy}
|
109 |
+
- **Expert Role:** {expert_role}
|
110 |
+
- **Related Topics:** {related_topics}
|
111 |
+
|
112 |
+
**Additional Instructions:**
|
113 |
+
- Ensure your response is well-structured and easy to follow.
|
114 |
+
- Use relevant examples to illustrate key points.
|
115 |
+
- Tailor your language to the specified complexity level.
|
116 |
+
""".strip()
|
117 |
+
|
118 |
+
def save_feedback_to_notion(user_prompt, improvement_suggestion, timestamp):
|
119 |
+
try:
|
120 |
+
notion.pages.create(
|
121 |
+
parent={"database_id": NOTION_DATABASE_ID},
|
122 |
+
properties={
|
123 |
+
"User Prompt": {"title": [{"text": {"content": user_prompt}}]},
|
124 |
+
"Improvement Suggestion": {"rich_text": [{"text": {"content": improvement_suggestion}}]}
|
125 |
+
}
|
126 |
+
)
|
127 |
+
return True
|
128 |
+
except Exception as e:
|
129 |
+
# Log the error to the console instead of displaying it in the Streamlit app
|
130 |
+
print(f"Error saving to Notion: {str(e)}")
|
131 |
+
return False
|
132 |
+
|
133 |
+
def main():
|
134 |
+
# Display the title and animation
|
135 |
+
st.markdown('<h1 class="big-font">Prompt easz</h1>', unsafe_allow_html=True)
|
136 |
+
st.markdown('<h2 class="center-text">AI Prompt Generator</h2>', unsafe_allow_html=True)
|
137 |
+
|
138 |
+
# Load and display Lottie animation
|
139 |
+
lottie_animation = load_lottiefile("animation.json") # Replace with your Lottie file path
|
140 |
+
col1, col2, col3 = st.columns([1,2,1])
|
141 |
+
with col2:
|
142 |
+
st_lottie(lottie_animation, speed=1, height=400, key="initial")
|
143 |
+
|
144 |
+
# Add About link with icon below the Lottie animation
|
145 |
+
col1, col2, col3 = st.columns([1,2,1])
|
146 |
+
with col2:
|
147 |
+
st.markdown(
|
148 |
+
'<div style="text-align: center;">'
|
149 |
+
'<a href="/About" target="_blank" style="text-decoration: none;">'
|
150 |
+
'<span style="font-size: 24px;">ℹ️</span> '
|
151 |
+
'<span style="vertical-align: middle;">About</span>'
|
152 |
+
'</a>'
|
153 |
+
'</div>',
|
154 |
+
unsafe_allow_html=True
|
155 |
+
)
|
156 |
+
|
157 |
+
user_input = st.text_input("What would you like a prompt for?")
|
158 |
+
|
159 |
+
if user_input:
|
160 |
+
suggested_types = find_prompt_types(user_input)
|
161 |
+
prompt_types = load_prompts()
|
162 |
+
categories_info = load_categories()
|
163 |
+
|
164 |
+
unique_types = list(set(list(prompt_types.keys()) + suggested_types))
|
165 |
+
|
166 |
+
topic = st.text_input("📌 Main Topic:", value=user_input)
|
167 |
+
category = st.selectbox("🏷️ Category or Field:", options=list(categories_info.keys()), index=0)
|
168 |
+
complexity = st.select_slider("🧠 Complexity Level:", options=["low", "medium", "high"], value="medium")
|
169 |
+
|
170 |
+
st.write("Choose Your Prompt")
|
171 |
+
|
172 |
+
selected_tab = st.selectbox("Select Prompt Type:", unique_types)
|
173 |
+
|
174 |
+
if selected_tab in prompt_types:
|
175 |
+
topic2 = st.text_input(f"📌 Second Topic for {selected_tab}:", key=f"{selected_tab}_topic2") if selected_tab == "Comparative Analysis" else None
|
176 |
+
constraint = st.number_input(f"🔢 Word Limit for {selected_tab}:", min_value=10, max_value=500, value=50, key=f"{selected_tab}_constraint") if selected_tab == "Constraint Addition" else None
|
177 |
+
|
178 |
+
prompt = generate_prompt(selected_tab, topic, category, complexity, topic2, constraint)
|
179 |
+
st.markdown(prompt)
|
180 |
+
|
181 |
+
# Add feedback collection section
|
182 |
+
st.subheader("Provide Feedback")
|
183 |
+
improvement_suggestion = st.text_area("What can be improved in this prompt?", height=100)
|
184 |
+
|
185 |
+
if st.button("Submit Feedback"):
|
186 |
+
if improvement_suggestion:
|
187 |
+
timestamp = datetime.now().isoformat()
|
188 |
+
if save_feedback_to_notion(prompt, improvement_suggestion, timestamp):
|
189 |
+
st.success("Feedback saved to Notion successfully!")
|
190 |
+
else:
|
191 |
+
st.error("Failed to save feedback to Notion.")
|
192 |
+
else:
|
193 |
+
st.warning("Please provide feedback before submitting.")
|
194 |
+
|
195 |
+
st.markdown("---")
|
196 |
+
st.markdown("""
|
197 |
+
### 🌟 How to Use AI Prompt Wizard Ultimate
|
198 |
+
1. Enter your desired topic or question.
|
199 |
+
2. Adjust the main topic, category, and complexity if needed.
|
200 |
+
3. Select the prompt type from the dropdown.
|
201 |
+
4. View the generated prompt.
|
202 |
+
5. Provide feedback on what can be improved in the prompt.
|
203 |
+
6. Submit your feedback to help us enhance our prompt generation.
|
204 |
+
""")
|
205 |
+
|
206 |
+
if __name__ == "__main__":
|
207 |
+
main()
|
categories.json
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"Programming Platforms": {
|
3 |
+
"keywords": ["leetcode", "hackerrank", "codewars", "topcoder", "coding challenges", "competitive programming"],
|
4 |
+
"analogy": "a gym for programmers",
|
5 |
+
"expert_role": "a competitive programmer",
|
6 |
+
"target_audience": "aspiring software developers",
|
7 |
+
"related_topics": ["algorithm design", "data structures", "time complexity", "space complexity"]
|
8 |
+
},
|
9 |
+
"Programming Languages": {
|
10 |
+
"keywords": ["python", "java", "javascript", "c++", "ruby", "go", "rust", "swift"],
|
11 |
+
"analogy": "different dialects in the world of coding",
|
12 |
+
"expert_role": "a polyglot programmer",
|
13 |
+
"target_audience": "software developers and computer science students",
|
14 |
+
"related_topics": ["syntax", "paradigms", "compilers", "interpreters", "type systems"]
|
15 |
+
},
|
16 |
+
"Web Development": {
|
17 |
+
"keywords": ["html", "css", "react", "angular", "vue", "node.js", "django", "flask", "responsive design"],
|
18 |
+
"analogy": "building and decorating houses on the internet",
|
19 |
+
"expert_role": "a full-stack web developer",
|
20 |
+
"target_audience": "web designers and developers",
|
21 |
+
"related_topics": ["front-end", "back-end", "APIs", "databases", "web security"]
|
22 |
+
},
|
23 |
+
"Data Science": {
|
24 |
+
"keywords": ["machine learning", "data analysis", "statistics", "big data", "data visualization", "neural networks"],
|
25 |
+
"analogy": "mining for insights in a sea of information",
|
26 |
+
"expert_role": "a data scientist",
|
27 |
+
"target_audience": "analysts and researchers",
|
28 |
+
"related_topics": ["predictive modeling", "clustering", "regression", "classification", "deep learning"]
|
29 |
+
},
|
30 |
+
"Cloud Computing": {
|
31 |
+
"keywords": ["aws", "azure", "google cloud", "cloud computing", "serverless", "microservices"],
|
32 |
+
"analogy": "renting powerful computers and services over the internet",
|
33 |
+
"expert_role": "a cloud architect",
|
34 |
+
"target_audience": "IT professionals and business decision-makers",
|
35 |
+
"related_topics": ["scalability", "virtualization", "container orchestration", "cloud security"]
|
36 |
+
},
|
37 |
+
"Cybersecurity": {
|
38 |
+
"keywords": ["network security", "encryption", "firewalls", "penetration testing", "ethical hacking"],
|
39 |
+
"analogy": "building and maintaining digital fortresses",
|
40 |
+
"expert_role": "a cybersecurity specialist",
|
41 |
+
"target_audience": "IT security professionals and concerned users",
|
42 |
+
"related_topics": ["threat detection", "incident response", "cryptography", "security policies"]
|
43 |
+
},
|
44 |
+
"Artificial Intelligence": {
|
45 |
+
"keywords": ["ai", "machine learning", "neural networks", "deep learning", "natural language processing"],
|
46 |
+
"analogy": "teaching computers to think and learn like humans",
|
47 |
+
"expert_role": "an AI researcher",
|
48 |
+
"target_audience": "data scientists and AI enthusiasts",
|
49 |
+
"related_topics": ["computer vision", "reinforcement learning", "expert systems", "robotics"]
|
50 |
+
},
|
51 |
+
"Mobile Development": {
|
52 |
+
"keywords": ["ios", "android", "react native", "flutter", "mobile apps", "responsive design"],
|
53 |
+
"analogy": "crafting pocket-sized software experiences",
|
54 |
+
"expert_role": "a mobile app developer",
|
55 |
+
"target_audience": "smartphone users and app creators",
|
56 |
+
"related_topics": ["user interface design", "app store optimization", "cross-platform development"]
|
57 |
+
},
|
58 |
+
"Biology": {
|
59 |
+
"keywords": ["cell", "dna", "evolution", "genetics", "ecology", "photosynthesis", "organism"],
|
60 |
+
"analogy": "exploring the intricate machinery of life",
|
61 |
+
"expert_role": "a biologist",
|
62 |
+
"target_audience": "biology students and researchers",
|
63 |
+
"related_topics": ["cellular biology", "molecular biology", "genetics", "ecology", "evolution"]
|
64 |
+
},
|
65 |
+
"General": {
|
66 |
+
"keywords": ["general", "miscellaneous", "other"],
|
67 |
+
"analogy": "a relevant comparison",
|
68 |
+
"expert_role": "a knowledgeable professional",
|
69 |
+
"target_audience": "interested individuals",
|
70 |
+
"related_topics": ["relevant concepts", "associated ideas", "connected subjects"]
|
71 |
+
}
|
72 |
+
}
|
feedback.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
|
pages/About.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
def about():
|
4 |
+
st.title("About Prompt easz")
|
5 |
+
|
6 |
+
col1, col2 = st.columns([2, 1]) # Adjust the ratio as needed
|
7 |
+
|
8 |
+
with col1:
|
9 |
+
st.write("""
|
10 |
+
**Prompt easz** is a prompt converter built based on sentence transformers. It helps in tuning prompts based on defined styles such as ELI5, chain of thoughts, role play, etc. This tool is designed to make learning new topics less overwhelming by providing tailored prompts.
|
11 |
+
""")
|
12 |
+
|
13 |
+
st.header("What It Does")
|
14 |
+
|
15 |
+
st.write("""
|
16 |
+
Though we can use ChatGPT to get responses, sometimes the generated responses can be overwhelming, especially when learning a new topic. Prompt easz helps by:
|
17 |
+
|
18 |
+
- Converting user prompts to vector embeddings using a sentence transformer.
|
19 |
+
- Finding cosine similarity between the user's prompt and a set of predefined prompts.
|
20 |
+
- Suggesting an updated prompt based on this similarity.
|
21 |
+
- Allowing users to pick the prompt strength (low to high).
|
22 |
+
- Providing predefined categories and identifying user question keywords accordingly.
|
23 |
+
- Offering flexibility for users to pick their own style, making the prompt generator customizable.
|
24 |
+
""")
|
25 |
+
|
26 |
+
st.header("Prompt Types and Categories")
|
27 |
+
|
28 |
+
st.write("""
|
29 |
+
- 10 main prompt types (e.g., ELI5, Chain-of-Thought, Role Play)
|
30 |
+
- Each prompt type has 3-4 variations
|
31 |
+
- 10 predefined categories (e.g., Programming Platforms, Data Science)
|
32 |
+
- Approximately 32 total prompt variations
|
33 |
+
- Around 320 possible combinations of prompt styles and categories
|
34 |
+
""")
|
35 |
+
|
36 |
+
st.header("Theory")
|
37 |
+
|
38 |
+
st.write("""
|
39 |
+
Let's dig into the theory of sentence transformers in three steps:
|
40 |
+
|
41 |
+
1. **What are they?**
|
42 |
+
- Sentence transformers are alternatives built to replace RNNs (Recurrent Neural Networks).
|
43 |
+
2. **Architecture:**
|
44 |
+
- They use the encoder part of the transformer architecture to convert input into embeddings (context vectors). For example, BART.
|
45 |
+
- The model used in Prompt easz is developed by Google: all-MiniLM-L6-v2.
|
46 |
+
3. **Use Cases:**
|
47 |
+
- Used for Q&A, sentence translation, semantic search, clustering, and semantic textual similarity tasks.
|
48 |
+
""")
|
49 |
+
|
50 |
+
st.header("Pros and Cons")
|
51 |
+
|
52 |
+
col1_1, col1_2 = st.columns(2)
|
53 |
+
|
54 |
+
with col1_1:
|
55 |
+
st.subheader("Pros")
|
56 |
+
st.write("""
|
57 |
+
- Generates prompt styles based on predefined categories.
|
58 |
+
- Customizable by the user.
|
59 |
+
""")
|
60 |
+
|
61 |
+
with col1_2:
|
62 |
+
st.subheader("Cons")
|
63 |
+
st.write("""
|
64 |
+
- Limited to a few categories.
|
65 |
+
- Does not auto-correct lexicon and grammar mistakes.
|
66 |
+
- Potential for more diverse prompt styles.
|
67 |
+
- Can be further extended and retrained based on user feedback.
|
68 |
+
""")
|
69 |
+
|
70 |
+
with col2:
|
71 |
+
st.image("IMG_0652.jpg", width=600)
|
72 |
+
|
73 |
+
if __name__ == "__main__":
|
74 |
+
about()
|
pages/test.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
|
prompts.json
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"ELI5": [
|
3 |
+
{
|
4 |
+
"description": "Simplify complex concepts for easy understanding.",
|
5 |
+
"template": "Explain {topic} as if you're talking to a 5-year-old in the context of {category}.",
|
6 |
+
"keywords": ["simple", "explain", "easy", "understand", "basic"]
|
7 |
+
},
|
8 |
+
{
|
9 |
+
"description": "Make a complex topic simple for beginners.",
|
10 |
+
"template": "Describe {topic} in {category} using simple terms a 5-year-old could understand.",
|
11 |
+
"keywords": ["simple", "beginner", "basic", "easy", "child"]
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"description": "Break down a difficult topic into easy steps.",
|
15 |
+
"template": "Break down the concept of {topic} in {category} into simple steps for anyone to grasp.",
|
16 |
+
"keywords": ["break down", "easy steps", "simplify", "understand", "concept"]
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"description": "Provide an analogy to simplify a complex concept.",
|
20 |
+
"template": "Compare {topic} in {category} to something simple, like {analogy}.",
|
21 |
+
"keywords": ["analogy", "compare", "simplify", "concept", "understand"]
|
22 |
+
}
|
23 |
+
],
|
24 |
+
"Chain-of-Thought": [
|
25 |
+
{
|
26 |
+
"description": "Show step-by-step reasoning.",
|
27 |
+
"template": "Walk through the process of {topic} in {category}, explaining each step in detail.",
|
28 |
+
"keywords": ["process", "steps", "reasoning", "walkthrough", "detailed"]
|
29 |
+
},
|
30 |
+
{
|
31 |
+
"description": "Break down the steps to understand a concept.",
|
32 |
+
"template": "Explain the steps involved in {topic} within {category}, detailing each stage.",
|
33 |
+
"keywords": ["steps", "breakdown", "process", "detailed", "explain"]
|
34 |
+
},
|
35 |
+
{
|
36 |
+
"description": "Explore the progression of {topic} in {category} from start to finish.",
|
37 |
+
"template": "Trace the evolution of {topic} in {category}, starting from its origins to its current state.",
|
38 |
+
"keywords": ["progression", "evolution", "trace", "origins", "current state"]
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"description": "Outline the logical steps in understanding {topic} in {category}.",
|
42 |
+
"template": "Outline the logical sequence of understanding {topic} in {category}, step by step.",
|
43 |
+
"keywords": ["logical steps", "outline", "sequence", "understanding", "concept"]
|
44 |
+
}
|
45 |
+
],
|
46 |
+
"Role Play": [
|
47 |
+
{
|
48 |
+
"description": "Respond as a specific character or expert.",
|
49 |
+
"template": "As a {category} expert, describe {topic} and its implications.",
|
50 |
+
"keywords": ["expert", "perspective", "role", "character", "specialist"]
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"description": "Take on the role of a specialist to explain a concept.",
|
54 |
+
"template": "Imagine you're a {category} specialist. Explain {topic} and its significance.",
|
55 |
+
"keywords": ["specialist", "role-play", "character", "explain", "perspective"]
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"description": "Present a scenario where {topic} in {category} is crucial.",
|
59 |
+
"template": "Create a scenario where understanding {topic} in {category} is essential, playing the role of an expert.",
|
60 |
+
"keywords": ["scenario", "essential", "role-play", "expert", "understanding"]
|
61 |
+
}
|
62 |
+
],
|
63 |
+
"Socratic Method": [
|
64 |
+
{
|
65 |
+
"description": "Use probing questions to explore a topic.",
|
66 |
+
"template": "What are the key aspects of {topic} in {category}? What counterarguments exist for each point?",
|
67 |
+
"keywords": ["questions", "explore", "debate", "socratic", "inquiry"]
|
68 |
+
},
|
69 |
+
{
|
70 |
+
"description": "Ask deep questions to delve into a subject.",
|
71 |
+
"template": "Explore {topic} in {category} by asking probing questions and considering counterarguments.",
|
72 |
+
"keywords": ["questions", "deep", "probe", "explore", "counterarguments"]
|
73 |
+
},
|
74 |
+
{
|
75 |
+
"description": "Question the assumptions underlying {topic} in {category}.",
|
76 |
+
"template": "Challenge the assumptions behind {topic} in {category} by asking critical questions.",
|
77 |
+
"keywords": ["question assumptions", "critical questions", "challenge", "understanding", "topic"]
|
78 |
+
}
|
79 |
+
],
|
80 |
+
"Comparative Analysis": [
|
81 |
+
{
|
82 |
+
"description": "Compare and contrast different ideas.",
|
83 |
+
"template": "Compare and contrast {topic} with {topic2} in the field of {category}.",
|
84 |
+
"keywords": ["compare", "contrast", "differences", "similarities", "analysis"]
|
85 |
+
},
|
86 |
+
{
|
87 |
+
"description": "Analyze the differences and similarities between two concepts.",
|
88 |
+
"template": "Discuss the similarities and differences between {topic} and {topic2} within {category}.",
|
89 |
+
"keywords": ["differences", "similarities", "analyze", "compare", "contrast"]
|
90 |
+
},
|
91 |
+
{
|
92 |
+
"description": "Evaluate the pros and cons of {topic} versus {topic2} in {category}.",
|
93 |
+
"template": "Evaluate the advantages and disadvantages of {topic} compared to {topic2} in {category}.",
|
94 |
+
"keywords": ["evaluate", "advantages", "disadvantages", "pros", "cons"]
|
95 |
+
}
|
96 |
+
],
|
97 |
+
"Few-Shot Learning": [
|
98 |
+
{
|
99 |
+
"description": "Learn about {topic} in {category} with minimal information.",
|
100 |
+
"template": "Explain {topic} in {category} using limited knowledge as a starting point.",
|
101 |
+
"keywords": ["learn", "minimal information", "starting point", "topic", "category"]
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"description": "Understand {topic} in {category} with just a few examples.",
|
105 |
+
"template": "Use a few examples to illustrate the concept of {topic} in {category} effectively.",
|
106 |
+
"keywords": ["understand", "examples", "illustrate", "concept", "effective"]
|
107 |
+
},
|
108 |
+
{
|
109 |
+
"description": "Introduce {topic} in {category} with minimal background.",
|
110 |
+
"template": "Introduce the basics of {topic} in {category} with only a few pieces of information.",
|
111 |
+
"keywords": ["introduce", "basics", "minimal background", "topic", "category"]
|
112 |
+
}
|
113 |
+
],
|
114 |
+
"Template Filling": [
|
115 |
+
{
|
116 |
+
"description": "Fill in the blanks to explain {topic} in {category}.",
|
117 |
+
"template": "Complete the sentence: {topic} is important in {category} because _________________.",
|
118 |
+
"keywords": ["fill in the blank", "complete", "sentence", "explain", "topic"]
|
119 |
+
},
|
120 |
+
{
|
121 |
+
"description": "Complete the template: {topic} is essential in {category} because _________________.",
|
122 |
+
"template": "Fill in the missing part: {topic} plays a crucial role in {category} because _________________.",
|
123 |
+
"keywords": ["complete", "essential", "template", "role", "category"]
|
124 |
+
},
|
125 |
+
{
|
126 |
+
"description": "Use a template to explain the significance of {topic} in {category}.",
|
127 |
+
"template": "Explain why {topic} matters in {category} using the following template: _________________.",
|
128 |
+
"keywords": ["explain", "significance", "template", "matter", "category"]
|
129 |
+
}
|
130 |
+
],
|
131 |
+
"Storytelling": [
|
132 |
+
{
|
133 |
+
"description": "Tell a story related to {topic} in {category}.",
|
134 |
+
"template": "Share a story that illustrates the impact of {topic} in {category}.",
|
135 |
+
"keywords": ["story", "impact", "illustrate", "related", "topic"]
|
136 |
+
},
|
137 |
+
{
|
138 |
+
"description": "Narrate a scenario involving {topic} in {category}.",
|
139 |
+
"template": "Imagine a scenario where {topic} in {category} led to a significant outcome.",
|
140 |
+
"keywords": ["scenario", "narrate", "significant outcome", "involving", "topic"]
|
141 |
+
},
|
142 |
+
{
|
143 |
+
"description": "Create a narrative around {topic} in {category}.",
|
144 |
+
"template": "Craft a narrative that explores the journey of {topic} in {category}.",
|
145 |
+
"keywords": ["create", "narrative", "explore", "journey", "topic"]
|
146 |
+
}
|
147 |
+
],
|
148 |
+
"Constraint Addition": [
|
149 |
+
{
|
150 |
+
"description": "Explain {topic} within {category} with a specific constraint.",
|
151 |
+
"template": "Describe {topic} in {category}, adhering to the constraint of _________________.",
|
152 |
+
"keywords": ["explain", "specific constraint", "describe", "adhering", "topic"]
|
153 |
+
},
|
154 |
+
{
|
155 |
+
"description": "Provide insights about {topic} in {category} under a defined condition.",
|
156 |
+
"template": "Offer insights into {topic} within {category}, considering the condition of _________________.",
|
157 |
+
"keywords": ["provide insights", "defined condition", "offer", "considering", "topic"]
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"description": "Explore {topic} in {category} while considering a specific limitation.",
|
161 |
+
"template": "Explore {topic} in {category}, taking into account the limitation of _________________.",
|
162 |
+
"keywords": ["explore", "considering", "specific limitation", "taking into account", "topic"]
|
163 |
+
}
|
164 |
+
],
|
165 |
+
"Reverse Prompting": [
|
166 |
+
{
|
167 |
+
"description": "Create a question or topic from {topic} in {category}.",
|
168 |
+
"template": "Formulate a question or topic based on {topic} in {category}.",
|
169 |
+
"keywords": ["create", "question", "formulate", "topic", "based on"]
|
170 |
+
},
|
171 |
+
{
|
172 |
+
"description": "Generate a new idea or concept inspired by {topic} in {category}.",
|
173 |
+
"template": "Develop a new idea or concept that builds on {topic} in {category}.",
|
174 |
+
"keywords": ["generate", "new idea", "develop", "concept", "builds on"]
|
175 |
+
},
|
176 |
+
{
|
177 |
+
"description": "Propose a different perspective or angle on {topic} in {category}.",
|
178 |
+
"template": "Present an alternative viewpoint or approach to {topic} in {category}.",
|
179 |
+
"keywords": ["propose", "different perspective", "alternative viewpoint", "approach", "topic"]
|
180 |
+
}
|
181 |
+
]
|
182 |
+
}
|
requirements.txt
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
nltk
|
2 |
+
streamlit
|
3 |
+
sentence-transformers
|
4 |
+
torch
|
5 |
+
requests
|
6 |
+
nltk
|
7 |
+
streamlit_lottie
|
8 |
+
notion-client
|
9 |
+
transformers
|
10 |
+
faiss-cpu
|
11 |
+
textblob
|