Spaces:
Runtime error
Runtime error
kingabzpro
commited on
Commit
•
979b48e
1
Parent(s):
ae4c56c
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,8 @@ article = "<p style='text-align: center'><a href='https://medium.com/geekculture
|
|
22 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
23 |
import torch
|
24 |
|
25 |
-
|
26 |
-
|
27 |
|
28 |
def predict(input, history=[]):
|
29 |
# tokenize the new input sentence
|
@@ -40,7 +40,7 @@ def predict(input, history=[]):
|
|
40 |
|
41 |
return response, history
|
42 |
|
43 |
-
gr.Interface
|
44 |
|
45 |
#theme ="grass",
|
46 |
#title = title,
|
|
|
22 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
23 |
import torch
|
24 |
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained("kingabzpro/DialoGPT-small-Rick-Bot")
|
26 |
+
model = AutoModelForCausalLM.from_pretrained("kingabzpro/DialoGPT-small-Rick-Bot")
|
27 |
|
28 |
def predict(input, history=[]):
|
29 |
# tokenize the new input sentence
|
|
|
40 |
|
41 |
return response, history
|
42 |
|
43 |
+
gr.Interface(fn = predict,inputs = "textbox", outputs = "chatbot",allow_flagging = "manual",theme ="grass",title = title,lagging_callback=hf_writer,description = description, article = article ).launch(enable_queue=True) # customizes the input component
|
44 |
|
45 |
#theme ="grass",
|
46 |
#title = title,
|