Commit
·
cee1d41
1
Parent(s):
d8d7b29
Refactor predict_language function and update interface inputs and outputs
Browse files
app.py
CHANGED
@@ -213,9 +213,21 @@ def predict_language(
|
|
213 |
hub_id, total_rows_for_split, 1000, max_request_calls, config, split
|
214 |
)
|
215 |
logger.info(f"Predicting language for {len(random_rows)} rows")
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
interface.queue()
|
221 |
interface.launch()
|
|
|
213 |
hub_id, total_rows_for_split, 1000, max_request_calls, config, split
|
214 |
)
|
215 |
logger.info(f"Predicting language for {len(random_rows)} rows")
|
216 |
+
predictions = predict_rows(random_rows, target_column)
|
217 |
+
predictions["hub_id"] = hub_id
|
218 |
+
predictions["config"] = config
|
219 |
+
predictions["split"] = split
|
220 |
+
return predictions
|
221 |
+
|
222 |
+
|
223 |
+
inputs = [
|
224 |
+
gr.Text(label="dataset id"),
|
225 |
+
gr.Textbox(
|
226 |
+
None,
|
227 |
+
label="config",
|
228 |
+
),
|
229 |
+
gr.Textbox(None, label="split"),
|
230 |
+
]
|
231 |
+
interface = gr.Interface(predict_language, inputs=inputs, outputs="json")
|
232 |
interface.queue()
|
233 |
interface.launch()
|