Spaces:
Runtime error
Runtime error
Update spaces
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ all_words = data["all_words"]
|
|
37 |
tags = data["tags"]
|
38 |
model_state = data["model_state"]
|
39 |
|
40 |
-
device = torch.device('
|
41 |
model = NeuralNetwork(input_size, hidden_size, output_size).to(device)
|
42 |
model.load_state_dict(model_state)
|
43 |
model.eval()
|
@@ -79,7 +79,7 @@ def predict(sentence):
|
|
79 |
return "Saya tidak mengerti pertanyaan Anda."
|
80 |
|
81 |
# Buat interface Gradio
|
82 |
-
iface = gr.Interface(fn=predict, inputs="text", outputs="
|
83 |
|
84 |
# Jalankan interface
|
85 |
iface.launch(share=True)
|
|
|
37 |
tags = data["tags"]
|
38 |
model_state = data["model_state"]
|
39 |
|
40 |
+
device = torch.device('cpu')
|
41 |
model = NeuralNetwork(input_size, hidden_size, output_size).to(device)
|
42 |
model.load_state_dict(model_state)
|
43 |
model.eval()
|
|
|
79 |
return "Saya tidak mengerti pertanyaan Anda."
|
80 |
|
81 |
# Buat interface Gradio
|
82 |
+
iface = gr.Interface(fn=predict, inputs="text", outputs="text", title="Chatbot Hukum Pajak")
|
83 |
|
84 |
# Jalankan interface
|
85 |
iface.launch(share=True)
|