Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 16 additions & 50 deletions emissor_chat/BlenderBotChat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,19 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "264d6d78-6056-4719-b73a-1dce15dcf805",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "44050fcffa264f27ace0a94f232d32dc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"generation_config.json: 0%| | 0.00/347 [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "00f98678c88c44708434f0231447ee6a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"tokenizer.json: 0%| | 0.00/310k [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/annika/anaconda3/envs/combots_2024/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"source": [
Expand All @@ -70,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "8cbf30f1-b1a0-4793-a71d-d9c0cacd2961",
"metadata": {
"tags": []
Expand All @@ -79,10 +59,8 @@
"source": [
"context_size = 5\n",
"def get_answer_from_blender(prompt:str, history_list:[]):\n",
" answer = \"\"\n",
" sentences = []\n",
" history = \"\"\n",
" for i, his in enumerate(history):\n",
" for i, his in enumerate(history_list):\n",
" if i==context_size:\n",
" break\n",
" history += his +\". \"\n",
Expand All @@ -104,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"id": "89a29313-9cd6-4321-9f0d-fd2746ae2ac6",
"metadata": {
"tags": []
Expand All @@ -128,7 +106,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"id": "1fa6d0c3-a5fa-4a5a-b2f9-093ee36aba51",
"metadata": {
"tags": []
Expand All @@ -139,21 +117,9 @@
"output_type": "stream",
"text": [
"BlenderBot: Say whatever you want to say and I will respond. Say \"stop\" or \"bye\" to quit.\n",
"BlenderBot: Hi Piek. How are you doing?\n"
]
},
{
"name": "stdin",
"output_type": "stream",
"text": [
"BlenderBot: Hi Piek. How are you doing?\n",
"\n",
" bye\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"bye\n",
"Piek: bye\n"
]
}
Expand Down Expand Up @@ -201,9 +167,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "combots_2024",
"language": "python",
"name": "python3"
"name": "combots_2024"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -215,7 +181,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down