Hamza1702 commited on
Commit
9876178
·
1 Parent(s): 24a6695

Update App.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
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("microsoft/DialoGPT-large")
12
- model = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-large")
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=[]):