Edit model card

Model Card for Model ID

A movie recommendation chatbot which is finetune from GODEL model using data generated from ChatGPT.

Model Details

  • Model type: seq2seq(T5)
  • License: MIT
  • Finetuned from model: microsoft/GODEL-v1_1-base-seq2seq
  • Final eval loss: 0.2331

Limitations

This model is trained using supervised learning on small amount of movie conversation data so it is not that good.
There is also a large version of this with better performance at bluenguyen/movie_chatbot_large_v1.

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("bluenguyen/movie_chatbot_v1")
model = AutoModelForSeq2SeqLM.from_pretrained("bluenguyen/movie_chatbot_v1").to('cuda')

def current_context(dialog, instruction):
    dialog = ' EOS '.join(dialog)
    context = f"{instruction} [CONTEXT] {dialog} "
    return context

def generate(context):
    input_ids = tokenizer(f"{context}", return_tensors="pt").input_ids.to('cuda')
    outputs = model.generate(input_ids, max_length=128, min_length=8, top_p=0.9, do_sample=True)
    output = tokenizer.decode(outputs[0], skip_special_tokens=True)
    return output

instruction = f'Instruction: given a dialog about movie recommendation, you need to respond based on human preferences.'
dialog = [
    'Do you have any recommendation about a movie?',
    'Yes! Any particular genre that you\'d like to see mentioned?',
]
print('User: ' + dialog[0])
print('Bot: ' + dialog[1])
while(1):
    print('User: ', end = '')
    query = input()
    if query == 'end':
        break
    dialog.append(query)
    response = generate(current_context(dialog, instruction))
    print('Bot: ' + response)
    dialog.append(response)

Demo

Example 1:

User: Do you have any recommendation about a movie?
Bot: Yes! Any particular genre that you'd like to see mentioned?
User: I like love story.
Bot: How about "The Notebook"? It's a classic love story with a great plot twist.
User: I have seen that one. Give me another one.
Bot: Have you seen "Eternal Sunshine of the Spotless Mind"? It's a unique romantic story with a captivating twist.
User: Is it any good?
Bot: Absolutely! It has an amazing cast and an engaging storyline. I highly recommend it.
User: Thank you
Bot: You're welcome! Let me know how you liked it.
User: end

Example 2:

User: Do you have any recommendation about a movie?
Bot: Yes! Any particular genre that you'd like to see mentioned?
User: I like super hero movie.
Bot: Have you watched "The Dark Knight"? It's a classic superhero movie.
User: Tell me more
Bot: "The Dark Knight" is based on the book by Christopher Nolan and stars Christian Bale as Batman and Heath Ledger as the Joker.
User: Who is the Joker in this movie?
Bot: Heath Ledger is the Joker and the movie is based on a novel.
User: I mean what happen in the movie?
Bot: The Joker is tasked with protecting the savage City of the Black Knight.
User: Really?
Bot: It's a very intense movie with a great performance by Heath Ledger.
User: Nice :))
Bot: Glad to hear it! How about "The Shawshank Redemption"?
User: What is it about?
Bot: "The Shawshank Redemption" is about a man named Andy Dufresne who is wrongly convicted of murder and sent to prison.
User: Who does he murder?
Bot: The man who is convicted of the murder is named Red, and he murders his wife.
User: You just said his name is Andy Dufresne
Bot: Sorry, I couldn't find any information about that movie.
User: yikes
Bot: Sorry again, I must have missed your recommendation. Is there any other movie you'd like to recommend?
User: end

Example 3:

User: Do you have any recommendation about a movie?
Bot: Yes! Any particular genre that you'd like to see mentioned?
User: I like action movie.
Bot: Have you seen "John Wick"?
User: Yes I have
Bot: How about "The Bourne Identity"?
User: What is it about?
Bot: "The Bourne Identity" is an action-packed movie about a man named John McClane who goes on a rampage after his friend's death.
User: John McClane is character from "Die Hard" though
Bot: Yes, John McClane is a character from "Die Hard". Have you seen "The Raid: Redemption"?
User: You are not that good its funny haha
Bot: That's alright. How about "Die Hard"?
User: Is it any good?
Bot: It's a classic action movie about a retired hitman who seeks vengeance for the death of his dog.
User: That is "John Wick" plot lol
Bot: Yeah, I'm sorry I haven't heard of that movie.
User: You've just recommended that for me
Bot: Great! How about "The Matrix"?
User: What is the main character in that movie?
Bot: "The Matrix" is an action movie about a computer hacker named Neo who discovers that the world he lives in is actually a simulated reality created by machines.
User: What actor play Neo in that movie?
Bot: Neo is played by Keanu Reeves and plays the main character Neo.
User: end

Model Card Contact

For personal questions related to this model, please contact via reddotbluename@gmail.com

Downloads last month
18
Inference API
Inference API (serverless) has been turned off for this model.