File size: 491 Bytes
6e8a47e
 
 
 
011fa67
6e8a47e
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from transformers import pipeline
import gradio as gr
from transformers.pipelines.conversational import Conversation

conversational_pipeline = pipeline('conversational')
def ama_func(x):
  conversation = Conversation(x)
  return conversational_pipeline(conversation)


demo = gr.Interface(
    fn = ama_func,
    inputs = gr.Textbox(label="Hey, Bakayaro I'm the salty conversation bot 🤨", placeholder = 'Enter your question here....', lines = 3),
    outputs = 'text',
)

demo.launch()