Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,15 @@
|
|
1 |
-
|
2 |
-
from transformers import pipeline
|
3 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
import gradio as gr
|
5 |
import torch
|
6 |
|
7 |
-
# Use a pipeline as a high-level helper
|
8 |
-
|
9 |
-
pipe = pipeline("conversational", model="facebook/blenderbot-400M-distill")
|
10 |
|
11 |
title = "🤖AI ChatBot"
|
12 |
description = "Building open-domain chatbots is a challenging area for machine learning research."
|
13 |
examples = [["How are you?"]]
|
14 |
|
15 |
|
16 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
17 |
-
model =
|
18 |
|
19 |
|
20 |
def predict(input, history=[]):
|
@@ -49,4 +44,4 @@ gr.Interface(
|
|
49 |
inputs=["text", "state"],
|
50 |
outputs=["chatbot", "state"],
|
51 |
theme="finlaymacklon/boxy_violet",
|
52 |
-
).launch(
|
|
|
1 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
|
|
|
|
|
|
|
5 |
|
6 |
title = "🤖AI ChatBot"
|
7 |
description = "Building open-domain chatbots is a challenging area for machine learning research."
|
8 |
examples = [["How are you?"]]
|
9 |
|
10 |
|
11 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-large")
|
12 |
+
model = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-large")
|
13 |
|
14 |
|
15 |
def predict(input, history=[]):
|
|
|
44 |
inputs=["text", "state"],
|
45 |
outputs=["chatbot", "state"],
|
46 |
theme="finlaymacklon/boxy_violet",
|
47 |
+
).launch()
|