Spaces:
Sleeping
Sleeping
fix upload error
Browse files
app.py
CHANGED
@@ -41,16 +41,9 @@ def file_prediction(file):
|
|
41 |
for news in news_list:
|
42 |
if news.strip():
|
43 |
pred = prediction(news)
|
44 |
-
results.append(
|
45 |
-
|
46 |
-
output = "News Article | Predictions\n"
|
47 |
-
output += "-" * 50 + "\n"
|
48 |
-
for result in results:
|
49 |
-
output += f"{result['news']} | {result['predictions']}\n"
|
50 |
-
return output
|
51 |
-
|
52 |
-
|
53 |
|
|
|
54 |
|
55 |
gradio_ui = gr.Interface(
|
56 |
fn=prediction,
|
@@ -74,3 +67,4 @@ gradio_file_ui = gr.Interface(
|
|
74 |
gradio_combined_ui = gr.TabbedInterface([gradio_ui, gradio_file_ui], ["Text Input", "File Upload"])
|
75 |
|
76 |
gradio_combined_ui.launch()
|
|
|
|
41 |
for news in news_list:
|
42 |
if news.strip():
|
43 |
pred = prediction(news)
|
44 |
+
results.append([news, pred])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
return results
|
47 |
|
48 |
gradio_ui = gr.Interface(
|
49 |
fn=prediction,
|
|
|
67 |
gradio_combined_ui = gr.TabbedInterface([gradio_ui, gradio_file_ui], ["Text Input", "File Upload"])
|
68 |
|
69 |
gradio_combined_ui.launch()
|
70 |
+
|