File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,21 +71,15 @@ NLP tasks often need to be broken down into simpler subtasks to be executed in a
7171Launch 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```
9084Feel free to prompt the chatbot with a few prompts of your own.
9185
You can’t perform that action at this time.
0 commit comments