crscardellino commited on
Commit
9d47eb9
1 Parent(s): b161832

Added determinism to the cell with the chatbot

Browse files
Files changed (1) hide show
  1. flisol-cordoba-2023.ipynb +5 -2
flisol-cordoba-2023.ipynb CHANGED
@@ -498,8 +498,11 @@
498
  },
499
  "outputs": [],
500
  "source": [
 
501
  "from chatbot import ChatBot # local module in the repository\n",
502
  "\n",
 
 
503
  "PROMPT = \"\"\"\n",
504
  "La siguiente es una conversación entre un HUMANO y un bot EXPERTO en software libre.\n",
505
  "El EXPERTO le ayuda al HUMANO con preguntas acerca de software libre.\n",
@@ -514,13 +517,13 @@
514
  " initial_prompt=PROMPT,\n",
515
  " keep_context=True,\n",
516
  " creative=True,\n",
517
- " human_identifier='HUMAN',\n",
518
  " bot_identifier='EXPERTO'\n",
519
  ")\n",
520
  "\n",
521
  "while True:\n",
522
  " input_text = input('> ')\n",
523
- " if input_text == 'exit' or input_text == 'quit':\n",
524
  " break\n",
525
  " print(chatbot.chat(input_text))"
526
  ]
 
498
  },
499
  "outputs": [],
500
  "source": [
501
+ "import torch\n",
502
  "from chatbot import ChatBot # local module in the repository\n",
503
  "\n",
504
+ "torch.manual_seed(42) # to be more deterministic\n",
505
+ "\n",
506
  "PROMPT = \"\"\"\n",
507
  "La siguiente es una conversación entre un HUMANO y un bot EXPERTO en software libre.\n",
508
  "El EXPERTO le ayuda al HUMANO con preguntas acerca de software libre.\n",
 
517
  " initial_prompt=PROMPT,\n",
518
  " keep_context=True,\n",
519
  " creative=True,\n",
520
+ " human_identifier='HUMANO',\n",
521
  " bot_identifier='EXPERTO'\n",
522
  ")\n",
523
  "\n",
524
  "while True:\n",
525
  " input_text = input('> ')\n",
526
+ " if input_text == 'exit':\n",
527
  " break\n",
528
  " print(chatbot.chat(input_text))"
529
  ]