Skip to content

Commit d33b3e4

Browse files
authored
Update 01-basicConcepts.md
Fixed broken chatbot code
1 parent a45d3e3 commit d33b3e4

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

_episodes/01-basicConcepts.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,15 @@ NLP tasks often need to be broken down into simpler subtasks to be executed in a
7171
Launch either colab or our Anaconda environment, depending on your setup. Try following the example below.
7272

7373
```python
74-
from transformers import pipeline, Conversation
75-
converse = pipeline("conversational", model="microsoft/DialoGPT-medium")
74+
from transformers import pipeline
75+
76+
text2text_generator = pipeline("text2text-generation")
77+
print(text2text_generator("question: What is 42 ? context: 42 is the answer to life, the universe and everything"))
7678

77-
conversation_1 = Conversation("Going to the movies tonight - any suggestions?")
78-
conversation_2 = Conversation("What's the last book you have read?")
79-
converse([conversation_1, conversation_2])
8079
```
8180

8281
```txt
83-
[Conversation id: 91dc8c91-cec7-4826-8a26-2d6c06298696
84-
user >> Going to the movies tonight - any suggestions?
85-
bot >> The Big Lebowski ,
86-
Conversation id: f7b2a7b4-a941-4f0f-88a3-3153626278e8
87-
user >> What's the last book you have read?
88-
bot >> The Last Question ]
82+
[{'generated_text': 'the answer to life, the universe and everything'}]
8983
```
9084
Feel free to prompt the chatbot with a few prompts of your own.
9185

0 commit comments

Comments
 (0)