File tree 1 file changed +5
-11
lines changed
1 file changed +5
-11
lines changed 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
71
71
Launch either colab or our Anaconda environment, depending on your setup. Try following the example below.
72
72
73
73
``` 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" ))
76
78
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])
80
79
```
81
80
82
81
``` 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'}]
89
83
```
90
84
Feel free to prompt the chatbot with a few prompts of your own.
91
85
You can’t perform that action at this time.
0 commit comments