Spaces:
Sleeping
Sleeping
Update FilterBQ
Browse files
FilterBQ
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def extract_bq_codes_from_json(json_str):
|
| 4 |
-
import json
|
| 5 |
data = json.loads(json_str)
|
| 6 |
projecttemplates = data.get("projecttemplates", [])
|
| 7 |
codes = set()
|
|
@@ -13,8 +13,11 @@ def extract_bq_codes_from_json(json_str):
|
|
| 13 |
codes.add(bqcode)
|
| 14 |
return list(codes)
|
| 15 |
|
| 16 |
-
iface = gr.Interface(
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import json
|
| 3 |
|
| 4 |
def extract_bq_codes_from_json(json_str):
|
|
|
|
| 5 |
data = json.loads(json_str)
|
| 6 |
projecttemplates = data.get("projecttemplates", [])
|
| 7 |
codes = set()
|
|
|
|
| 13 |
codes.add(bqcode)
|
| 14 |
return list(codes)
|
| 15 |
|
| 16 |
+
iface = gr.Interface(
|
| 17 |
+
fn=extract_bq_codes_from_json,
|
| 18 |
+
inputs=gr.Textbox(label="JSON Input"),
|
| 19 |
+
outputs=gr.JSON(label="Extracted BQ Codes"),
|
| 20 |
+
title="BQ Code Extractor"
|
| 21 |
+
)
|
| 22 |
|
| 23 |
iface.launch()
|