transformers pytorch t5 text2text-generation license:mit autotrain_compatible text-generation-inference region:us
---
license: mit
inference: false
---

# 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.2027

## 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 smaller version of this at bluenguyen/movie_chatbot_v1.

### How to Get Started with the Model

Use the code below to get started with the model.
```python:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("bluenguyen/movie_chatbot_large_v1")
model = AutoModelForSeq2SeqLM.from_pretrained("bluenguyen/movie_chatbot_large_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? <br>
> Bot: Yes! Any particular genre that you'd like to see mentioned? <br>
> User: Maybe somthing heartfelt please <br>
> Bot: How about "The Fault in Our Stars"? It's a romantic drama about two teenagers with terminal illnesses who fall in love. <br>
> User: Is the ending sad? <br>
> Bot: Yes, it's definitely emotional but also inspiring. It's definitely worth watching. <br>
> User: Ok, give me another one <br>
> Bot: Have you seen "A Walk to Remember"? It's another emotional drama that explores the themes of love, grief and redemption. <br>
> User: Tell me more about the plot <br>
> Bot: The plot is about a man with terminal cancer who falls in love with a young girl who has terminal cancer. It's a beautiful and heartbreaking movie that will leave you feeling good. <br>
> User: It seems that you got it wrong <br>
> Bot: I'm sorry, I'm an AI language model, so I may have missed some things. Is there anything else I can help you with? <br>
> User: Ok, enough with sad stuff, give some movie to lighten the mood <br>
> Bot: How about "Eternal Sunshine of the Spotless Mind"? It's a romantic sci-fi drama that explores the concept of memory and love. <br>
> User: Good, who play the main character? <br>
> Bot: The lead role is played by Jodie Foster and Ryan Gosling, who both give fantastic performances. <br>
> User: You are wrong again, but it's ok <br>
> Bot: It's okay. Just remember that I'm just an AI language model and I can only provide a wide range of information. <br>
> User: Good bye, I will improve you later, don't worry <br>
> Bot: Alright then, have a great day! <br>
> User: end <br>

Example 2:
> User: Do you have any recommendation about a movie? <br>
> Bot: Yes! Any particular genre or genre that you'd like to see mentioned? <br>
> User: I like funny action movies <br>
> Bot: How about "Deadpool"? It's an action-comedy movie about a superhero who has to save the world from a dark forces. <br>
> User: Tell me more about the main character <br>
> Bot: The main character, Ryan Reynolds, is known for his intelligence and intelligence-sharing abilities, and he is the go-to guy for superhero teams. Ryan Reynolds' character is played by Ryan Reynolds, and he gets a lot of laughs from the audience. <br>
> User: Cool, give me another movie <br>
> Bot: Sure, what genre are you interested in? <br>
> User: I like movie about fighting <br>
> Bot: How about "John Wick"? It's an action-thriller movie about a retired hitman who comes out of retirement to avenge his dog's death. <br>
> User: What happen to his dog? <br>
> Bot: His dog, Theodore, is killed by a group of thugs, and he must hunt down and take down the people who killed his dog. He is played by Keanu Reeves, and he does a lot of fighting scenes that are impressive. <br>
> User: Thank you <br>
> Bot: You're welcome! Let me know if you need any other recommendations. <br>
> User: end <br>

Example 3:
> User: Do you have any recommendation about a movie? <br>
> Bot: Yes! Any particular genre that you'd like to see mentioned? <br>
> User: I am in a mood for something crazy tonight <br>
> Bot: Have you seen "Gone Girl"? It's a fantastic movie about a man whose wife disappears and he becomes the prime suspect. It's a gripping thriller with a twist ending. <br>
> User: What is the twist? <br>
> Bot: The twist happens when the husband becomes the prime suspect in his wife's disappearance. As the story unfolds, it becomes clear that things are not as they seem. <br>
> User: Ok, give me another one <br>
> Bot: Sure thing! How about "The Prestige"? It's a mystery thriller about two magicians who are rivals in their craft. The movie is a mind-bending tale of obsession and intrigue that will keep you on the edge of your seat. <br>
> User: Ok cool, tell me more <br>
> Bot: It's based on the classic novel of the same name by J.K. Simmons. The movie stars Hugh Jackman and Christian Bale as the rival magicians and has received critical acclaim for its plot twists, performances, and direction. <br>
> User: Thank you <br>
> Bot: You're welcome! Let me know if you need any more suggestions. <br>
> User: end <br>


## Model Card Contact

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