Spaces:
Running
Running
Fix column layout
Browse files
app.ipynb
CHANGED
|
@@ -663,14 +663,14 @@
|
|
| 663 |
},
|
| 664 |
{
|
| 665 |
"cell_type": "code",
|
| 666 |
-
"execution_count":
|
| 667 |
"metadata": {},
|
| 668 |
"outputs": [
|
| 669 |
{
|
| 670 |
"name": "stdout",
|
| 671 |
"output_type": "stream",
|
| 672 |
"text": [
|
| 673 |
-
"Running on local URL: http://127.0.0.1:
|
| 674 |
"\n",
|
| 675 |
"To create a public link, set `share=True` in `launch()`.\n"
|
| 676 |
]
|
|
@@ -678,7 +678,7 @@
|
|
| 678 |
{
|
| 679 |
"data": {
|
| 680 |
"text/html": [
|
| 681 |
-
"<div><iframe src=\"http://127.0.0.1:
|
| 682 |
],
|
| 683 |
"text/plain": [
|
| 684 |
"<IPython.core.display.HTML object>"
|
|
@@ -691,7 +691,7 @@
|
|
| 691 |
"data": {
|
| 692 |
"text/plain": []
|
| 693 |
},
|
| 694 |
-
"execution_count":
|
| 695 |
"metadata": {},
|
| 696 |
"output_type": "execute_result"
|
| 697 |
}
|
|
@@ -756,9 +756,34 @@
|
|
| 756 |
" label=\"Chat Output\",\n",
|
| 757 |
" )\n",
|
| 758 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 759 |
" with gr.Row():\n",
|
| 760 |
-
"
|
| 761 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 762 |
" inference_chat,\n",
|
| 763 |
" [\n",
|
| 764 |
" model_id,\n",
|
|
@@ -770,31 +795,6 @@
|
|
| 770 |
" ],\n",
|
| 771 |
" [chatbot, state],\n",
|
| 772 |
" )\n",
|
| 773 |
-
"\n",
|
| 774 |
-
" with gr.Row():\n",
|
| 775 |
-
" clear_button = gr.Button(value=\"Clear\", interactive=True)\n",
|
| 776 |
-
" clear_button.click(\n",
|
| 777 |
-
" lambda: (\"\", [], []),\n",
|
| 778 |
-
" [],\n",
|
| 779 |
-
" [chat_input, chatbot, state],\n",
|
| 780 |
-
" queue=False,\n",
|
| 781 |
-
" )\n",
|
| 782 |
-
"\n",
|
| 783 |
-
" submit_button = gr.Button(\n",
|
| 784 |
-
" value=\"Submit\", interactive=True, variant=\"primary\"\n",
|
| 785 |
-
" )\n",
|
| 786 |
-
" submit_button.click(\n",
|
| 787 |
-
" inference_chat,\n",
|
| 788 |
-
" [\n",
|
| 789 |
-
" model_id,\n",
|
| 790 |
-
" prompt_template,\n",
|
| 791 |
-
" chat_input,\n",
|
| 792 |
-
" temperature,\n",
|
| 793 |
-
" top_p,\n",
|
| 794 |
-
" state,\n",
|
| 795 |
-
" ],\n",
|
| 796 |
-
" [chatbot, state],\n",
|
| 797 |
-
" )\n",
|
| 798 |
"iface.launch()\n"
|
| 799 |
]
|
| 800 |
},
|
|
@@ -817,7 +817,7 @@
|
|
| 817 |
},
|
| 818 |
{
|
| 819 |
"cell_type": "code",
|
| 820 |
-
"execution_count":
|
| 821 |
"metadata": {},
|
| 822 |
"outputs": [],
|
| 823 |
"source": [
|
|
|
|
| 663 |
},
|
| 664 |
{
|
| 665 |
"cell_type": "code",
|
| 666 |
+
"execution_count": 31,
|
| 667 |
"metadata": {},
|
| 668 |
"outputs": [
|
| 669 |
{
|
| 670 |
"name": "stdout",
|
| 671 |
"output_type": "stream",
|
| 672 |
"text": [
|
| 673 |
+
"Running on local URL: http://127.0.0.1:7868\n",
|
| 674 |
"\n",
|
| 675 |
"To create a public link, set `share=True` in `launch()`.\n"
|
| 676 |
]
|
|
|
|
| 678 |
{
|
| 679 |
"data": {
|
| 680 |
"text/html": [
|
| 681 |
+
"<div><iframe src=\"http://127.0.0.1:7868/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
| 682 |
],
|
| 683 |
"text/plain": [
|
| 684 |
"<IPython.core.display.HTML object>"
|
|
|
|
| 691 |
"data": {
|
| 692 |
"text/plain": []
|
| 693 |
},
|
| 694 |
+
"execution_count": 31,
|
| 695 |
"metadata": {},
|
| 696 |
"output_type": "execute_result"
|
| 697 |
}
|
|
|
|
| 756 |
" label=\"Chat Output\",\n",
|
| 757 |
" )\n",
|
| 758 |
"\n",
|
| 759 |
+
" with gr.Column():\n",
|
| 760 |
+
" chat_input = gr.Textbox(lines=1, label=\"Chat Input\")\n",
|
| 761 |
+
" chat_input.submit(\n",
|
| 762 |
+
" inference_chat,\n",
|
| 763 |
+
" [\n",
|
| 764 |
+
" model_id,\n",
|
| 765 |
+
" prompt_template,\n",
|
| 766 |
+
" chat_input,\n",
|
| 767 |
+
" temperature,\n",
|
| 768 |
+
" top_p,\n",
|
| 769 |
+
" state,\n",
|
| 770 |
+
" ],\n",
|
| 771 |
+
" [chatbot, state],\n",
|
| 772 |
+
" )\n",
|
| 773 |
+
"\n",
|
| 774 |
" with gr.Row():\n",
|
| 775 |
+
" clear_button = gr.Button(value=\"Clear\", interactive=True)\n",
|
| 776 |
+
" clear_button.click(\n",
|
| 777 |
+
" lambda: (\"\", [], []),\n",
|
| 778 |
+
" [],\n",
|
| 779 |
+
" [chat_input, chatbot, state],\n",
|
| 780 |
+
" queue=False,\n",
|
| 781 |
+
" )\n",
|
| 782 |
+
"\n",
|
| 783 |
+
" submit_button = gr.Button(\n",
|
| 784 |
+
" value=\"Submit\", interactive=True, variant=\"primary\"\n",
|
| 785 |
+
" )\n",
|
| 786 |
+
" submit_button.click(\n",
|
| 787 |
" inference_chat,\n",
|
| 788 |
" [\n",
|
| 789 |
" model_id,\n",
|
|
|
|
| 795 |
" ],\n",
|
| 796 |
" [chatbot, state],\n",
|
| 797 |
" )\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 798 |
"iface.launch()\n"
|
| 799 |
]
|
| 800 |
},
|
|
|
|
| 817 |
},
|
| 818 |
{
|
| 819 |
"cell_type": "code",
|
| 820 |
+
"execution_count": 32,
|
| 821 |
"metadata": {},
|
| 822 |
"outputs": [],
|
| 823 |
"source": [
|