Update App.py
Browse files
app.py
CHANGED
@@ -1,15 +1,20 @@
|
|
|
|
|
|
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("
|
12 |
-
model = AutoModelForCausalLM.from_pretrained("
|
13 |
|
14 |
|
15 |
def predict(input, history=[]):
|
|
|
1 |
+
|
2 |
+
from transformers import pipeline
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
import gradio as gr
|
5 |
import torch
|
6 |
|
7 |
+
# Use a pipeline as a high-level helper
|
8 |
+
|
9 |
+
pipe = pipeline("conversational", model="PygmalionAI/pygmalion-6b")
|
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("PygmalionAI/pygmalion-6b")
|
17 |
+
model = AutoModelForCausalLM.from_pretrained("PygmalionAI/pygmalion-6b")
|
18 |
|
19 |
|
20 |
def predict(input, history=[]):
|