arpitneema
commited on
Commit
•
d698ee5
1
Parent(s):
2e0f0bc
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,19 @@
|
|
1 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
2 |
import gradio as gr
|
3 |
import torch
|
|
|
4 |
|
5 |
|
6 |
title = "🤖AI ChatBot"
|
7 |
description = "A State-of-the-Art Large-scale Pretrained Response generation model (DialoGPT)"
|
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 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, TFAutoModelForQuestionAnswering
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
+
import tensorflow as tf
|
5 |
|
6 |
|
7 |
title = "🤖AI ChatBot"
|
8 |
description = "A State-of-the-Art Large-scale Pretrained Response generation model (DialoGPT)"
|
9 |
examples = [["How are you?"]]
|
10 |
|
11 |
+
model = TFAutoModelForQuestionAnswering.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad",return_dict=False)
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained("bert-large-uncased-whole-word-masking-finetuned-squad")
|
13 |
+
nlp = pipeline("question-answering", model=model, tokenizer=tokenizer)
|
14 |
|
15 |
+
# tokenizer = AutoTokenizer.from_pretrained("microsoft/DialoGPT-large")
|
16 |
+
# model = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-large")
|
17 |
|
18 |
|
19 |
def predict(input, history=[]):
|