rawanessam commited on
Commit
7098c0a
·
verified ·
1 Parent(s): a60f314

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,7 +7,6 @@ def extract_bq_codes_from_json(json_str):
7
  except json.JSONDecodeError:
8
  return {"error": "Invalid JSON"}
9
 
10
- # Access projecttemplates through the payload key
11
  projecttemplates = data.get("payload", {}).get("projecttemplates", [])
12
  codes = set()
13
  for project in projecttemplates:
@@ -22,7 +21,8 @@ iface = gr.Interface(
22
  fn=extract_bq_codes_from_json,
23
  inputs=gr.Textbox(lines=10, label="JSON Input"),
24
  outputs=gr.JSON(label="Extracted BQ Codes"),
25
- title="BQ Code Extractor"
 
26
  )
27
 
28
  if __name__ == "__main__":
 
7
  except json.JSONDecodeError:
8
  return {"error": "Invalid JSON"}
9
 
 
10
  projecttemplates = data.get("payload", {}).get("projecttemplates", [])
11
  codes = set()
12
  for project in projecttemplates:
 
21
  fn=extract_bq_codes_from_json,
22
  inputs=gr.Textbox(lines=10, label="JSON Input"),
23
  outputs=gr.JSON(label="Extracted BQ Codes"),
24
+ title="BQ Code Extractor",
25
+ api_name="predict" # This names the API endpoint
26
  )
27
 
28
  if __name__ == "__main__":