Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
| 3 |
-
from gradio.mcp import mcphandle
|
| 4 |
|
| 5 |
-
@mcphandle
|
| 6 |
def extract_bq_codes_from_json(json_str):
|
| 7 |
try:
|
| 8 |
data = json.loads(json_str)
|
|
@@ -18,9 +16,8 @@ def extract_bq_codes_from_json(json_str):
|
|
| 18 |
bqcode = detail.get("bqcodelibrary", {}).get("bqcode")
|
| 19 |
if bqcode:
|
| 20 |
codes.add(bqcode)
|
| 21 |
-
return
|
| 22 |
|
| 23 |
-
# Create the Gradio interface
|
| 24 |
iface = gr.Interface(
|
| 25 |
fn=extract_bq_codes_from_json,
|
| 26 |
inputs=gr.Textbox(lines=10, label="JSON Input"),
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
|
|
|
| 3 |
|
|
|
|
| 4 |
def extract_bq_codes_from_json(json_str):
|
| 5 |
try:
|
| 6 |
data = json.loads(json_str)
|
|
|
|
| 16 |
bqcode = detail.get("bqcodelibrary", {}).get("bqcode")
|
| 17 |
if bqcode:
|
| 18 |
codes.add(bqcode)
|
| 19 |
+
return list(codes)
|
| 20 |
|
|
|
|
| 21 |
iface = gr.Interface(
|
| 22 |
fn=extract_bq_codes_from_json,
|
| 23 |
inputs=gr.Textbox(lines=10, label="JSON Input"),
|