awacke1 commited on
Commit
e174780
Β·
verified Β·
1 Parent(s): d9745c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -1,4 +1,3 @@
1
- # app.py
2
  import gradio as gr
3
  import pandas as pd
4
  import requests
@@ -19,7 +18,7 @@ warnings.filterwarnings("ignore")
19
  DATASET_CONFIG = {
20
  "caselaw": {
21
  "name": "common-pile/caselaw_access_project", "emoji": "βš–οΈ",
22
- "methods": ["πŸ’¨ API (requests)", "🧊 Dask", "πŸ₯ Croissant"], "is_public": True,
23
  },
24
  "prompts": {
25
  "name": "fka/awesome-chatgpt-prompts", "emoji": "πŸ€–",
@@ -111,7 +110,7 @@ Content:
111
  return (
112
  pd.DataFrame(), gr.Gallery(None), f"### 🚨 Error\nAn error occurred. See the debug log below for details.",
113
  "", None, None, "", f"```python\n# 🚨 Error during execution:\n# {e}\n```",
114
- gr.Code(value=debug_log, language='text', visible=True) # Make the debug log visible
115
  )
116
 
117
  def search_dataframe(df: pd.DataFrame, query: str):
@@ -249,8 +248,8 @@ def create_dataset_tab(dataset_key: str):
249
 
250
  code_output = gr.Code(label="πŸ’» Python Code Snippet", language="python")
251
 
252
- # --- ✨ NEW Debug Log UI Component ---
253
- debug_log_output = gr.Code(label="🐞 Debug Log", language='text', visible=False)
254
 
255
  fetch_button.click(
256
  fn=fetch_data,
@@ -274,4 +273,4 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Hugging Face Dataset Explorer") as
274
  create_dataset_tab(key)
275
 
276
  if __name__ == "__main__":
277
- demo.launch(debug=True)
 
 
1
  import gradio as gr
2
  import pandas as pd
3
  import requests
 
18
  DATASET_CONFIG = {
19
  "caselaw": {
20
  "name": "common-pile/caselaw_access_project", "emoji": "βš–οΈ",
21
+ "methods": ["πŸ’¨ API (requests)", "οΏ½ Dask", "πŸ₯ Croissant"], "is_public": True,
22
  },
23
  "prompts": {
24
  "name": "fka/awesome-chatgpt-prompts", "emoji": "πŸ€–",
 
110
  return (
111
  pd.DataFrame(), gr.Gallery(None), f"### 🚨 Error\nAn error occurred. See the debug log below for details.",
112
  "", None, None, "", f"```python\n# 🚨 Error during execution:\n# {e}\n```",
113
+ gr.Code(value=debug_log, visible=True) # Make the debug log visible
114
  )
115
 
116
  def search_dataframe(df: pd.DataFrame, query: str):
 
248
 
249
  code_output = gr.Code(label="πŸ’» Python Code Snippet", language="python")
250
 
251
+ # --- ✨ NEW Debug Log UI Component (language parameter removed) ---
252
+ debug_log_output = gr.Code(label="🐞 Debug Log", visible=False)
253
 
254
  fetch_button.click(
255
  fn=fetch_data,
 
273
  create_dataset_tab(key)
274
 
275
  if __name__ == "__main__":
276
+ demo.launch(debug=True)