File size: 3,082 Bytes
f5ec828 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "6d7e0fa0",
"metadata": {},
"outputs": [],
"source": [
"!pip install -q git+https://github.com/srush/MiniChain\n",
"!git clone git+https://github.com/srush/MiniChain; cp -fr MiniChain/examples/* . "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6bc68605",
"metadata": {},
"outputs": [],
"source": [
"import gradio as gr\n",
"from chat import gradio as chat\n",
"from ner import gradio as ner\n",
"from math_demo import gradio as math_demo\n",
"from bash import gradio as bash\n",
"from pal import gradio as pal\n",
"from gatsby import gradio as gatsby\n",
"from qa import gradio as qa\n",
"from stats import gradio as stats\n",
"from selfask import gradio as selfask\n",
"from backtrack import gradio as backtrack"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a0a69443",
"metadata": {},
"outputs": [],
"source": [
"CSS = \"\"\"\n",
"#clean div.form {border: 0px} \n",
"#response {border: 0px; background: #ffeec6} \n",
"#prompt {border: 0px;background: aliceblue} \n",
"#json {border: 0px} \n",
"#result {border: 0px; background: #c5e0e5} \n",
"#inner {margin: 10px; padding: 10px; font-size: 20px; } \n",
"#inner textarea {border: 0px}\n",
"div.gradio-container {color: black}\n",
"span.head {font-size: 60pt; font-family: cursive;}\n",
"body {\n",
" --text-sm: 15px;\n",
" --text-md: 18px;\n",
" --text-lg: 20px;\n",
" --input-text-size: 20px;\n",
" --section-text-size: 20px;\n",
"}\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7eabd4da",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "ea4326bb",
"metadata": {},
"outputs": [],
"source": [
"with gr.Blocks(css=CSS, theme=gr.themes.Monochrome()) as demo:\n",
" gr.HTML(\"<center style='background:#B6B7BA'> <span class='head'>Mini</span><img src='https://user-images.githubusercontent.com/35882/227017900-0cacdfb7-37e2-47b1-9347-a233810d3544.png' width='20%' style='display:inline'><span class='head'>Chain</span></center><center> <br><a href='https://github.com/srush/minichain'>[library]</a> </center>\")\n",
"\n",
" gr.TabbedInterface([math_demo, qa, chat, gatsby, ner, bash, pal, stats, selfask, backtrack],\n",
" [\"Math\", \"QA\", \"Chat\", \"Book\", \"NER\", \"Bash\", \"PAL\", \"Stats\", \"SelfAsk\", \"Backtrack\"],\n",
" css = CSS)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a7c58fbd",
"metadata": {
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"demo.launch()"
]
}
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all",
"main_language": "python",
"notebook_metadata_filter": "-all"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|