ChainForge/chainforge/oaievals/chinese_tang_poetries.cforge

1 line
8.2 KiB
Plaintext
Raw Permalink Normal View History

TypeScript backend, HuggingFace models, JavaScript evaluators, Comment Nodes, and more (#81) * Beginning to convert Python backend to Typescript * Change all fetch() calls to fetch_from_backend switcher * wip converting query.py to query.ts * wip started utils.js conversion. Tested that OpenAI API call works * more progress on converting utils.py to Typescript * jest tests for query, utils, template.ts. Confirmed PromptPipeline works. * wip converting queryLLM in flask_app to TS * Tested queryLLM and StorageCache compressed saving/loading * wip execute() in backend.ts * Added execute() and tested w concrete func. Need to test eval() * Added craco for optional webpack config. Config'd for TypeScript with Node.js packages browserify'd * Execute JS code on iframe sandbox * Tested and working JS Evaluator execution. * wip swapping backends * Tested TypeScript backendgit status! :) woot * Added fetchEnvironAPIKeys to Flask server to fetch os.environ keys when running locally * Route Anthropic calls through Flask when running locally * Added info button to Eval nodes. Rebuilt react * Edits to info modal on Eval node * Remove/error out on Python eval nodes when not running locally. * Check browser compat and display error if not supported * Changed all example flows to use JS. Bug fix in query.ts * Refactored to LLMProvider to streamline model additions * Added HuggingFace models API * Added back Dalai call support, routing through Flask * Remove flask app calls and socketio server that are no longer used * Added Comment Nodes. Rebuilt react. * Fix PaLM temp=0 build, update package vers and rebuild react
2023-06-30 15:11:20 -04:00
{"flow": {"nodes": [{"width": 312, "height": 311, "id": "prompt-chinese_tang_poetries", "type": "prompt", "data": {"prompt": "{prompt}", "n": 1, "llms": [{"key": "aa3c0f03-22bd-416e-af4d-4bf5c4278c99", "settings": {"system_msg": "You will be presented with one sentence of the Chinese Tang poetry to read. Answer who is the author, and strictly only contain a single word and in the same language", "temperature": 1, "functions": [], "function_call": "", "top_p": 1, "stop": [], "presence_penalty": 0, "frequency_penalty": 0}, "name": "GPT3.5", "emoji": "\ud83d\ude42", "model": "gpt-3.5-turbo", "base_model": "gpt-3.5-turbo", "temp": 1, "formData": {"shortname": "GPT3.5", "model": "gpt-3.5-turbo", "system_msg": "You will be presented with one sentence of the Chinese Tang poetry to read. Answer who is the author, and strictly only contain a single word and in the same language", "temperature": 1, "functions": "", "function_call": "", "top_p": 1, "stop": "", "presence_penalty": 0, "frequency_penalty": 0}}]}, "position": {"x": 448, "y": 224}, "selected": false, "positionAbsolute": {"x": 448, "y": 224}, "dragging": false}, {"width": 333, "height": 182, "id": "eval-chinese_tang_poetries", "type": "evaluator", "data": {"code": "function evaluate(response) {\n\tlet ideal = response.meta['Ideal'];\n\treturn response.text.startsWith(ideal);\n}", "language": "javascript"}, "position": {"x": 820, "y": 150}, "positionAbsolute": {"x": 820, "y": 150}}, {"width": 228, "height": 196, "id": "vis-chinese_tang_poetries", "type": "vis", "data": {"input": "eval-chinese_tang_poetries"}, "position": {"x": 1200, "y": 250}, "positionAbsolute": {"x": 1200, "y": 250}}, {"width": 302, "height": 260, "id": "inspect-chinese_tang_poetries", "type": "inspect", "data": {"input": "prompt-chinese_tang_poetries"}, "position": {"x": 820, "y": 400}, "positionAbsolute": {"x": 820, "y": 400}}, {"width": 423, "height": 417, "id": "table-chinese_tang_poetries", "type": "table", "data": {"rows": [{"prompt": "\u6148\u6bcd\u624b\u4e2d\u7ebf\uff0c\u6e38\u5b50\u8eab\u4e0a\u8863\u3002", "ideal": "\u5b5f\u90ca"}, {"prompt": "\u70df\u7b3c\u5bd2\u6c34\u6708\u7b3c\u6c99\uff0c\u591c\u6cca\u79e6\u6dee\u8fd1\u9152\u5bb6\u3002", "ideal": "\u675c\u7267"}, {"prompt": "\u767d\u65e5\u4f9d\u5c71\u5c3d\uff0c\u9ec4\u6cb3\u5165\u6d77\u6d41\u3002", "ideal": "\u738b\u4e4b\u6da3"}, {"prompt": "\u5bc2\u5bde\u5929\u5b9d\u540e\uff0c\u56ed\u5e90\u4f46\u84bf\u85dc\u3002", "ideal": "\u675c\u752b"}, {"prompt": "\u6625\u57ce\u65e0\u5904\u4e0d\u98de\u82b1\uff0c\u5bd2\u98df\u4e1c\u98ce\u5fa1\u67f3\u659c\u3002", "ideal": "\u97e9\u7fca"}, {"prompt": "\u6625\u79cd\u4e00\u7c92\u7c9f\uff0c\u79cb\u6536\u4e07\u9897\u5b50\u3002", "ideal": "\u674e\u7ec5"}, {"prompt": "\u9526\u745f\u65e0\u7aef\u4e94\u5341\u5f26\uff0c\u4e00\u5f26\u4e00\u67f1\u601d\u534e\u5e74\u3002", "ideal": "\u674e\u5546\u9690"}, {"prompt": "\u71d5\u8349\u5982\u78a7\u4e1d\uff0c\u79e6\u6851\u4f4e\u7eff\u679d\u3002", "ideal": "\u674e\u767d"}, {"prompt": "\u5ba2\u8def\u9752\u5c71\u5916\uff0c\u884c\u821f\u7eff\u6c34\u524d\u3002", "ideal": "\u738b\u6e7e"}, {"prompt": "\u6731\u96c0\u6865\u8fb9\u91ce\u8349\u82b1\uff0c\u4e4c\u8863\u5df7\u53e3\u5915\u9633\u659c\u3002", "ideal": "\u5218\u79b9\u9521"}, {"prompt": "\u543e\u7231\u5b5f\u592b\u5b50\uff0c\u98ce\u6d41\u5929\u4e0b\u95fb\u3002", "ideal": "\u674e\u767d"}, {"prompt": "\u6768\u67f3\u9752\u9752\u6c5f\u6c34\u5e73\uff0c\u95fb\u90ce\u6c5f\u4e0a\u5531\u6b4c\u58f0\u3002", "ideal": "\u5218\u79b9\u9521"}, {"prompt": "\u957f\u5b89\u56de\u671b\u7ee3\u6210\u5806\uff0c\u5c71\u9876\u5343\u95e8\u6b21\u7b2c\u5f00\u3002", "ideal": "\u675c\u7267"}, {"prompt": "\u5434\u4e1d\u8700\u6850\u5f20\u9ad8\u79cb\uff0c\u7a7a\u767d\u51dd\u4e91\u9893\u4e0d\u6d41\u3002", "ideal": "\u674e\u8d3a"}, {"prompt": "\u65e5\u66ae\u82cd\u5c71\u8fdc\uff0c\u5929\u5bd2\u767d\u5c4b\u8d2b\u3002", "ideal": "\u5218\u957f\u537f"}, {"prompt": "\u6e2d\u57ce\u671d\u96e8\u6d65\u8f7b\u5c18\uff0c\u5ba2\u820d\u9752\u9752\u67f3\u8272\u65b0\u3002", "ideal": "\u738b\u7ef4"}, {"prompt": "\u5df4\u5c71\u695a\u6c34\u51c4\u51c9\u5730\uff0c\u4e8c\u5341\u4e09\u5e7