Skip to content

Commit

Permalink
added : text generator
Browse files Browse the repository at this point in the history
  • Loading branch information
sorohere committed Feb 11, 2024
1 parent 8071e9c commit bff5c82
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 231 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.vscode
.ipynb_checkpoints
.DS_Store
.DS_Store
*.gguf
.venv
__pycache__
1 change: 1 addition & 0 deletions streamlit/sign-language/processing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"nm":"Untitled file","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/creator 1.2.0"},"layers":[{"ty":0,"nm":" gears","sr":1,"st":0,"op":90,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[248.25,248.9072494888306]},"s":{"a":0,"k":[461.6938693478044,461.6938693478044]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[248.25,248.9072494888306]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"w":500,"h":500,"refId":"Scene 1","ind":1}],"v":"5.7.0","fr":30,"op":90,"ip":0,"assets":[{"nm":"gears","id":"Scene 1","fr":50,"layers":[{"ty":4,"nm":"gears Outlines - Group 1","sr":1,"st":0,"op":100,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[121.39700000000008,180.44899999999996],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[216.14699999999993,279.19900000000007],"ix":2},"r":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[-360],"t":99}],"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[2.817,-0.354],[-0.521,4.135],[-2.816,0.355],[0.521,-4.134]],"o":[[-4.134,0.521],[0.355,-2.816],[4.135,-0.521],[-0.355,2.816]],"v":[[0.822,6.268],[-6.268,-0.822],[-0.822,-6.268],[6.268,0.822]]},"ix":2}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[-0.063,0.774],[0,0],[0,0],[0.507,0.711],[0,0],[0,0],[0.917,0.251],[0,0],[0,0],[0.861,-0.37],[0,0],[0,0],[0.415,-0.775],[0,0],[0,0],[-0.147,-0.748],[0,0],[0,0],[-0.526,-0.419],[0,0],[0,0],[-0.318,0],[-0.314,0.014],[0,0],[0,0],[-0.483,0.468],[0,0],[0,0]],"o":[[0,0],[0,0],[-0.415,-0.775],[0,0],[0,0],[-0.861,-0.37],[0,0],[0,0],[-0.917,0.251],[0,0],[0,0],[-0.507,0.711],[0,0],[0,0],[0.063,0.774],[0,0],[0,0],[0.482,0.468],[0,0],[0,0],[0.314,0.014],[0.318,0],[0,0],[0,0],[0.526,-0.419],[0,0],[0,0],[0.146,-0.748]],"v":[[20.525,1.337],[14.21,-3.813],[18.165,-10.088],[16.777,-12.316],[9.275,-12.36],[8.124,-19.302],[5.454,-20.234],[-0.001,-15.736],[-5.453,-20.234],[-8.123,-19.302],[-9.274,-12.36],[-16.777,-12.316],[-18.165,-10.088],[-14.21,-3.813],[-20.525,1.337],[-20.212,3.62],[-12.495,5.907],[-14.342,14.414],[-12.829,15.746],[-4.934,12.25],[-0.949,20.21],[-0.001,20.234],[0.948,20.21],[4.935,12.25],[12.829,15.746],[14.342,14.414],[12.495,5.907],[20.213,3.62]]},"ix":2}},{"ty":"mm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Merge","nm":"Merge Paths 1","mm":1},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7373,0.7373,0.7373],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[121.397,180.449],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"gears Outlines - Group 2","sr":1,"st":0,"op":100,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[178.60299999999995,158.92200000000003],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[280.353,255.92199999999997],"ix":2},"r":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[-360],"t":99}],"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 2","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[2.817,-0.354],[-0.521,4.135],[-2.817,0.355],[0.522,-4.134]],"o":[[-4.134,0.521],[0.355,-2.816],[4.134,-0.521],[-0.354,2.816]],"v":[[0.822,6.268],[-6.268,-0.822],[-0.822,-6.268],[6.268,0.822]]},"ix":2}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[-0.063,0.774],[0,0],[0,0],[0.507,0.711],[0,0],[0,0],[0.917,0.252],[0,0],[0,0],[0.861,-0.369],[0,0],[0,0],[0.416,-0.775],[0,0],[0,0],[-0.147,-0.748],[0,0],[0,0],[-0.527,-0.419],[0,0],[0,0],[-0.319,0],[-0.314,0.014],[0,0],[0,0],[-0.482,0.468],[0,0],[0,0]],"o":[[0,0],[0,0],[-0.415,-0.775],[0,0],[0,0],[-0.862,-0.369],[0,0],[0,0],[-0.917,0.252],[0,0],[0,0],[-0.506,0.711],[0,0],[0,0],[0.064,0.774],[0,0],[0,0],[0.481,0.467],[0,0],[0,0],[0.315,0.014],[0.318,0],[0,0],[0,0],[0.526,-0.419],[0,0],[0,0],[0.146,-0.748]],"v":[[20.525,1.337],[14.209,-3.813],[18.165,-10.088],[16.777,-12.316],[9.274,-12.36],[8.124,-19.303],[5.453,-20.234],[0,-15.736],[-5.452,-20.234],[-8.124,-19.303],[-9.275,-12.36],[-16.778,-12.316],[-18.165,-10.088],[-14.209,-3.813],[-20.525,1.337],[-20.213,3.62],[-12.495,5.907],[-14.342,14.415],[-12.829,15.746],[-4.935,12.25],[-0.949,20.21],[0,20.234],[0.949,20.21],[4.934,12.25],[12.829,15.746],[14.342,14.415],[12.495,5.907],[20.212,3.62]]},"ix":2}},{"ty":"mm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Merge","nm":"Merge Paths 1","mm":1},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7373,0.7373,0.7373],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[178.603,158.922],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"gears Outlines - Group 3","sr":1,"st":0,"op":100,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[135.736,131.00599999999997],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[235.736,231.006],"ix":2},"r":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":99}],"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Group 3","ix":1,"cix":2,"np":4,"it":[{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[4.542,-0.572],[-0.84,6.665],[-4.542,0.572],[0.84,-6.665]],"o":[[-6.666,0.84],[0.573,-4.542],[6.665,-0.841],[-0.573,4.542]],"v":[[1.324,10.105],[-10.107,-1.326],[-1.325,-10.106],[10.106,1.324]]},"ix":2}},{"ty":"sh","bm":0,"hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[-0.103,1.247],[0,0],[0,0],[0.817,1.146],[0,0],[0,0],[1.479,0.404],[0,0],[0,0],[1.388,-0.597],[0,0],[0,0],[0.669,-1.248],[0,0],[0,0],[-0.235,-1.204],[0,0],[0,0],[-0.848,-0.676],[0,0],[0,0],[-0.512,0],[-0.507,0.023],[0,0],[0,0],[-0.778,0.754],[0,0],[0,0]],"o":[[0,0],[0,0],[-0.67,-1.248],[0,0],[0,0],[-1.388,-0.597],[0,0],[0,0],[-1.478,0.404],[0,0],[0,0],[-0.818,1.146],[0,0],[0,0],[0.102,1.247],[0,0],[0,0],[0.777,0.754],[0,0],[0,0],[0.507,0.023],[0.513,0],[0,0],[0,0],[0.848,-0.676],[0,0],[0,0],[0.236,-1.204]],"v":[[33.095,2.156],[22.91,-6.148],[29.289,-16.267],[27.051,-19.858],[14.953,-19.93],[13.097,-31.123],[8.792,-32.624],[-0.001,-25.373],[-8.794,-32.624],[-13.099,-31.123],[-14.954,-19.93],[-27.051,-19.858],[-29.29,-16.267],[-22.911,-6.148],[-33.095,2.156],[-32.591,5.835],[-20.148,9.523],[-23.125,23.242],[-20.686,25.387],[-7.957,19.752],[-1.53,32.585],[-0.001,32.625],[1.528,32.585],[7.956,19.752],[20.685,25.387],[23.124,23.242],[20.146,9.523],[32.589,5.835]]},"ix":2}},{"ty":"mm","bm":0,"hd":false,"mn":"ADBE Vector Filter - Merge","nm":"Merge Paths 1","mm":1},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7373,0.7373,0.7373],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[135.736,131.006],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3}]}]}
221 changes: 0 additions & 221 deletions streamlit/sign-language/streamlit.py

This file was deleted.

5 changes: 0 additions & 5 deletions streamlit/sign-language/translator/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ def translate(self, broken):
return extracted_text







text = "You are an AI Sign Language Translator. You are given sentences which are inferred from a vision model capturing words for signs. Expect the sentences to be broken. Your task is to transform the input sentences to the nearest correct output sentence. Even if the input sentence is grammatically incorrect, try to convey the most prominent response."
text += '''\nBroken: hi i saurabh
Correct: Hi I am Saurabh.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ def update_text(self):
translator = SignLanguageTranslator(default_text)


broken1 = "hi i shubham1"
broken1 = "hi i shubham"
translator.append_broken_sentence(broken1)



correct1 = "Hi i am Shubham1"
correct1 = "Hi i am Shubham"
translator.append_correct_sentence(correct1)

print(translator.text)

0 comments on commit bff5c82

Please sign in to comment.