Spaces:
Sleeping
Sleeping
Commit
•
5b392cd
1
Parent(s):
56a0845
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
|
2 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import gradio as gr
|
4 |
import torch
|
5 |
-
|
6 |
|
7 |
#import pickle
|
8 |
|
@@ -12,12 +12,12 @@ description = "Building open-domain chatbots is a challenging area for machine l
|
|
12 |
examples = [["Guvi Details"]]
|
13 |
|
14 |
model_name = "fine_tuned_model123"
|
15 |
-
|
16 |
-
|
17 |
|
18 |
# Load the tokenizer and model from Hugging Face Hub
|
19 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
20 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
21 |
|
22 |
def predict(input, history=[]):
|
23 |
# tokenize the new input sentence
|
|
|
1 |
|
2 |
+
#from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import gradio as gr
|
4 |
import torch
|
5 |
+
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
6 |
|
7 |
#import pickle
|
8 |
|
|
|
12 |
examples = [["Guvi Details"]]
|
13 |
|
14 |
model_name = "fine_tuned_model123"
|
15 |
+
model = GPT2LMHeadModel.from_pretrained(model_name)
|
16 |
+
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
|
17 |
|
18 |
# Load the tokenizer and model from Hugging Face Hub
|
19 |
+
#tokenizer = AutoTokenizer.from_pretrained(model_name)
|
20 |
+
#model = AutoModelForCausalLM.from_pretrained(model_name)
|
21 |
|
22 |
def predict(input, history=[]):
|
23 |
# tokenize the new input sentence
|