Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import torch, nltk
|
2 |
import gradio as gr
|
3 |
-
from transformers import AutoTokenizer,
|
4 |
|
5 |
""" Created by Riky Ripaldo """
|
6 |
nltk.download('punkt')
|
7 |
|
8 |
tokenz = AutoTokenizer.from_pretrained("microsoft/DialoGPT-medium")
|
9 |
-
modelz =
|
10 |
|
11 |
def balasan(chats):
|
12 |
input_ids = tokenz.encode(chats + tokenz.eos_token, return_tensors='pt')
|
|
|
1 |
import torch, nltk
|
2 |
import gradio as gr
|
3 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
|
5 |
""" Created by Riky Ripaldo """
|
6 |
nltk.download('punkt')
|
7 |
|
8 |
tokenz = AutoTokenizer.from_pretrained("microsoft/DialoGPT-medium")
|
9 |
+
modelz = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-medium")
|
10 |
|
11 |
def balasan(chats):
|
12 |
input_ids = tokenz.encode(chats + tokenz.eos_token, return_tensors='pt')
|