GithubHelp home page GithubHelp logo

blenderbot_paddle's Introduction

Hi this is kevin.

Domain: NLP (Large Language Model Training & Serving), Computer Vision (Conditional Image Gneration)

Interest: Front-End Design, Chatbot, AIoT

blenderbot_paddle's People

Contributors

kevinng77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

blenderbot_paddle's Issues

Using other model for conversation

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.