File size: 1,012 Bytes
86416c1
 
 
9a28abc
86416c1
 
27e93a3
9a28abc
 
 
a91ee97
 
 
42f9c56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# How to poop like a cat?

import gradio as gr
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)

# Create Gradio interface
#
#iface = gr.Interface(fn=generate_response, inputs="text", outputs="text")
#iface.launch()

#
title = "Ask Rick a Question"
description = """
The bot was trained to answer questions based on Rick and Morty dialogues. Ask Rick anything!
<img src="https://huggingface.co/spaces/course-demos/Rick_and_Morty_QA/resolve/main/rick.png" width=200px>
"""

article = "Check out [the original Rick and Morty Bot](https://huggingface.co/spaces/kingabzpro/Rick_and_Morty_Bot) that this demo is based off of."

iface = gr.Interface(
    fn=predict,
    inputs="textbox",
    outputs="text",
    title=title,
    description=description,
    article=article,
    examples=[["What are you doing?"], ["Where should we time travel to?"]],
)iface.launch()