Domain: NLP (Large Language Model Training & Serving), Computer Vision (Conditional Image Gneration)
Interest: Front-End Design, Chatbot, AIoT
用Paddle复现Recipes for building an open-domain chatbot论文
Hi, I tried to use this repo to do some conversation test, but when I change the model to small-90M, the results become weird. Here is the code I used for loading the model:
import paddle
from paddlenlp.transformers import BlenderbotSmallTokenizer,BlenderbotSmallForConditionalGeneration
model_name = "blenderbot_small-90M"
tokneizer = BlenderbotSmallTokenizer.from_pretrained(model_name)
model = BlenderbotSmallForConditionalGeneration.from_pretrained(model_name)
Then I use this code to enable the conversation:
print('Using model:' + model_name)
while True:
sample_text = input('User (input 'end' to end the conversation): \t')
if sample_text == 'end':
break
inputs = tokenizer(sample_text, return_attention_mask=True, return_token_type_ids=False)
inputs = {k: paddle.to_tensor([v]) for (k, v) in inputs.items()}
result_ids, scores = model.generate(input_ids=inputs['input_ids'],
max_length=60,
min_length=20,
decode_strategy='beam_search',
num_beams=10,
length_penalty=0.65)
for sequence_ids in result_ids.numpy().tolist():
print("bot:\t", tokenizer.convert_ids_to_string(sequence_ids))
Then I got these outputs:
Using model: blenderbot_small-90M
User (input 'end' to end the conversation): hello
bot: ET(T3%ip-ET(T3%ip-ET(T3%ip-ET(T3%ip-ET(T3�-ET(T3%ip-ET(T3%ip-ET(T3
User (input 'end' to end the conversation): end
Could you tell me what happened or what should I do ?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.