Update app.py
Browse files
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)", "
|
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,
|
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",
|
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)
|