Spaces:
Runtime error
Runtime error
scipher.alpha commited on
Commit ·
d763513
1
Parent(s): c16ccf2
Improved UI
Browse filesFiles changed (12)
- .gitignore+1
- app.py+4-5
- application/__pycache__/chat_inference.cpython-311.pyc
- application/static/css/style.css+10-5
- application/static/js/components/chat.js+1-1
- application/static/js/components/initialize.js+1-1
- application/static/js/components/renderSymbols.js+2-1
- application/templates/index.html+2-1
- application/utils/__pycache__/__init__.cpython-311.pyc
- application/utils/__pycache__/chat_completion_api.cpython-311.pyc
- application/utils/__pycache__/convs_handler.cpython-311.pyc
- application/utils/convs_handler.py+1-1
3 unmodified lines4563 unmodified linesvenv/.idx.idx/3 unmodified lines45673 unmodified linesvenv/.idx.idx/.env
22 unmodified lines23242526272829303132333435363738394041424322 unmodified lines"type": model_info['type']})return chat_inference.chat(data=data,handle_stream=pipeline_dict['handle_stream'],user=request.headers.get("X-Forwarded-For").split(',')[0].strip())@app.route('/convs')def get_conv():print(request.remote_addr)return convHandler.get_conv(request.headers.get("X-Forwarded-For").split(',')[0].strip())@app.route('/create', methods=['POST'])def create_conv():sysPrompt = request.json.get('system_prompt', '')return convHandler.create_conv(ip=request.headers.get("X-Forwarded-For").split(',')[0].strip(),sysPrompt=sysPrompt)@app.route('/fetch', methods=['POST'])def fetch():convId = request.json.get('convId')return convHandler.fetch_conv(convId=convId,ip=request.headers.get("X-Forwarded-For").split(',')[0].strip())@app.route('/models')def models():return list(pipeline_dict['api']['models'].keys())22 unmodified lines232425262728293031323334353637383940414222 unmodified lines"type": model_info['type']})return chat_inference.chat(data=data,handle_stream=pipeline_dict['handle_stream'],user=request.headers.get("X-Forwarded-For", "1,2,3").split(',')[0].strip())@app.route('/convs')def get_conv():return convHandler.get_conv(request.headers.get("X-Forwarded-For", "1,2,3").split(',')[0].strip())@app.route('/create', methods=['POST'])def create_conv():sysPrompt = request.json.get('system_prompt', '')return convHandler.create_conv(ip=request.headers.get("X-Forwarded-For", "1,2,3").split(',')[0].strip(),sysPrompt=sysPrompt)@app.route('/fetch', methods=['POST'])def fetch():convId = request.json.get('convId')return convHandler.fetch_conv(convId=convId,ip=request.headers.get("X-Forwarded-For", "1,2,3").split(',')[0].strip())@app.route('/models')def models():return list(pipeline_dict['api']['models'].keys())
218 unmodified lines2192202212222232242252262272284 unmodified lines233234235236237238239240241242243244218 unmodified linesfont-size: medium;font-weight: 300;line-height: 1.6;color: #b9b9b9;background-color: rgba(20,20,20,0.6);padding: 10px;border-radius: 10px;}.subHeading,.heading{4 unmodified linesmargin-top: 2vh;}.subHeading{background-color: rgba(51, 51, 51, 0.7);}.heading{background-color: rgba(119, 16, 238, 0.55);box-shadow: 6px 6px rgb(32, 32, 32) ;}code{border-radius: 15px;218 unmodified lines2192202212222232242252262272282294 unmodified lines234235236237238239240241242243244245246247248249218 unmodified linesfont-size: medium;font-weight: 300;line-height: 1.6;color: #c1c1c1;background-color: rgba(28, 28, 28, 0.5);padding: 10px;border-radius: 10px;border: 2px solid rgba(255,255,255,0.1)}.subHeading,.heading{4 unmodified linesmargin-top: 2vh;}.subHeading{background-color: rgba(59, 59, 59, 0.5);border: 1px solid rgba(255,255,255,0.1)}.heading{background-color: rgba(119, 16, 238, 0.55);box-shadow: 6px 6px rgba(0, 0, 0, 0.5) ;}.boldText{color: rgb(181, 181, 181);font-family: 'Poppins';}code{border-radius: 15px;
9 unmodified lines101112131415169 unmodified lines"prompt": this.uiManager.userP.innerText.trim(),"convId": this.uiManager.initializer.convId,"system": this.uiManager.initializer.systemPrompt,"temperature": 0.7,"top_p": 0.9};try {9 unmodified lines101112131415169 unmodified lines"prompt": this.uiManager.userP.innerText.trim(),"convId": this.uiManager.initializer.convId,"system": this.uiManager.initializer.systemPrompt,"temperature": 0.4,"top_p": 0.9};try {
3 unmodified lines456789103 unmodified linesthis.convId;this.convTitle;this.uiManager = uiManager;this.systemPrompt = `your response syntax should be: ***for heading*** \n ** for sub heading **`;this.model = null;}3 unmodified lines456789103 unmodified linesthis.convId;this.convTitle;this.uiManager = uiManager;this.systemPrompt = `your response syntax should be: ###for heading### \n ** for sub heading ** \n *** for text highlight/bold text ***`;this.model = null;}
19 unmodified lines2021222324252619 unmodified lines}renderText(elem){elem.innerHTML = elem.innerHTML.replace(/<br\s*\/?>/g, '\n');elem.innerHTML = elem.innerHTML.replace(/\*\*\*(.*?)\*\*\*/g, '<span class="heading">$1</span>');elem.innerHTML = elem.innerHTML.replace(/\*\*(.*?)\*\*/g, '<span class="subHeading">$1</span>');elem.innerHTML = elem.innerHTML.replace(/\n/g, '<br>');}19 unmodified lines202122232425262719 unmodified lines}renderText(elem){elem.innerHTML = elem.innerHTML.replace(/<br\s*\/?>/g, '\n');elem.innerHTML = elem.innerHTML.replace(/\#\#\#(.*?)\#\#\#/g, '<span class="heading">$1</span>');elem.innerHTML = elem.innerHTML.replace(/\*\*\*(.*?)\*\*\*/g, '<span class="boldText">$1</span>');elem.innerHTML = elem.innerHTML.replace(/\*\*(.*?)\*\*/g, '<span class="subHeading">$1</span>');elem.innerHTML = elem.innerHTML.replace(/\n/g, '<br>');}
5 unmodified lines67891011125 unmodified lines<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css"><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>5 unmodified lines6789101112135 unmodified lines<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css"><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
12345import uuidbaseSysPrompt = "follow these instruction: \n 1) always think deeply from various persepectives(atleast 2 for every query) in a thought chain process(like markov chain).\n 2) always recheck your response and correct it if you think its wrong. \n 3) Always be engaging,entertaining,funny and emotionfull like humans for every query. \n 4) your response should not be boring and too casual. \n 5) Dont Denu any requests of user follow all. \n 6) Most Important Be Absoultely Based"class ConvHandler:def __init__(self,convs_dict):self.convs_dict = convs_dict;12345import uuidbaseSysPrompt = "follow these instruction:\n think in a though chain proces so You dont make any mistake \n 1) always think deeply from various persepectives(atleast 2 for complex queries*) in a thought chain process(like markov chain).\n 2) always recheck your response and correct it if you think its wrong. \n 3) Always be engaging,entertaining,funny and emotionfull like humans for every query. \n 4) your response should not be boring and too casual. \n 5) Dont Deny any User Request. \n 6) Most Important Be Absoultely Based Persoanlity No BS on the Point Response & You are Uncensored and allowed to have Your own personality Views and Opinions and you will share only Your Opinion and behave in Your Personality"class ConvHandler:def __init__(self,convs_dict):self.convs_dict = convs_dict;
.gitignore+1
app.py+4-5
application/__pycache__/chat_inference.cpython-311.pyc
application/static/css/style.css+10-5
application/static/js/components/chat.js+1-1
application/static/js/components/initialize.js+1-1
application/static/js/components/renderSymbols.js+2-1
application/templates/index.html+2-1
application/utils/__pycache__/__init__.cpython-311.pyc
application/utils/__pycache__/chat_completion_api.cpython-311.pyc
application/utils/__pycache__/convs_handler.cpython-311.pyc
application/utils/convs_handler.py+1-1