Spaces:
Runtime error
Runtime error
Update spaces
Browse files
app.py
CHANGED
@@ -8,6 +8,8 @@ from torch.utils.data import Dataset, DataLoader
|
|
8 |
import random
|
9 |
import gradio as gr
|
10 |
|
|
|
|
|
11 |
with open('dataset.json', 'r') as file:
|
12 |
dataset = json.load(file)
|
13 |
|
@@ -77,7 +79,7 @@ def predict(sentence):
|
|
77 |
return "Saya tidak mengerti pertanyaan Anda."
|
78 |
|
79 |
# Buat interface Gradio
|
80 |
-
iface = gr.Interface(fn=predict, inputs="text", outputs="
|
81 |
|
82 |
# Jalankan interface
|
83 |
iface.launch(share=True)
|
|
|
8 |
import random
|
9 |
import gradio as gr
|
10 |
|
11 |
+
nltk.download('punkt')
|
12 |
+
|
13 |
with open('dataset.json', 'r') as file:
|
14 |
dataset = json.load(file)
|
15 |
|
|
|
79 |
return "Saya tidak mengerti pertanyaan Anda."
|
80 |
|
81 |
# Buat interface Gradio
|
82 |
+
iface = gr.Interface(fn=predict, inputs="text", outputs="markdown", title="Chatbot Hukum Pajak")
|
83 |
|
84 |
# Jalankan interface
|
85 |
iface.launch(share=True)
|