Spaces:
Running
Running
tokenized+output
Browse files
app.py
CHANGED
@@ -12,15 +12,15 @@ pipeline = pipeline(task="text-classification", model=distil_model, tokenizer=di
|
|
12 |
def predict(deepmoji_analysis):
|
13 |
predictions = pipeline(deepmoji_analysis)
|
14 |
|
15 |
-
output_text = ""
|
16 |
for p in predictions:
|
17 |
output_text += p['label'] + ' (' + str(p['score']) + ")\n"
|
18 |
-
return
|
19 |
|
20 |
gradio_app = gr.Interface(
|
21 |
fn=predict,
|
22 |
inputs="text",
|
23 |
-
outputs=
|
24 |
examples=[
|
25 |
"This GOT show just remember LOTR times!",
|
26 |
"Man, can't believe that my 30 days of training just got a NaN loss",
|
|
|
12 |
def predict(deepmoji_analysis):
|
13 |
predictions = pipeline(deepmoji_analysis)
|
14 |
|
15 |
+
output_text = "\n"
|
16 |
for p in predictions:
|
17 |
output_text += p['label'] + ' (' + str(p['score']) + ")\n"
|
18 |
+
return str(distil_tokenizer(deepmoji_analysis)["input_ids"]) + output_text
|
19 |
|
20 |
gradio_app = gr.Interface(
|
21 |
fn=predict,
|
22 |
inputs="text",
|
23 |
+
outputs="text",
|
24 |
examples=[
|
25 |
"This GOT show just remember LOTR times!",
|
26 |
"Man, can't believe that my 30 days of training just got a NaN loss",
|