Spaces:
Runtime error
Runtime error
rajeshradhakrishnan
commited on
Commit
•
71dfb76
1
Parent(s):
e658b02
unit tested and corrected the runtime errors
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
from pathlib import Path
|
2 |
-
import torch
|
3 |
import gradio as gr
|
4 |
from huggingface_hub import from_pretrained_fastai
|
5 |
|
@@ -13,9 +12,7 @@ def predict(news_headline):
|
|
13 |
|
14 |
probabilities = learner.predict(news_headline)
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
return {LABELS[i]: probabilities[0]['probs'][i] for i, v in range(len(LABELS))}
|
19 |
|
20 |
interface = gr.Interface(
|
21 |
predict,
|
|
|
1 |
from pathlib import Path
|
|
|
2 |
import gradio as gr
|
3 |
from huggingface_hub import from_pretrained_fastai
|
4 |
|
|
|
12 |
|
13 |
probabilities = learner.predict(news_headline)
|
14 |
|
15 |
+
return {LABELS[i]: probabilities[0]['probs'][i] for i in range(len(LABELS))}
|
|
|
|
|
16 |
|
17 |
interface = gr.Interface(
|
18 |
predict,
|