h2i commited on
Commit
584b04d
Β·
verified Β·
1 Parent(s): d599853

Update src/v2/streamlit_app_modified.py

Browse files
Files changed (1) hide show
  1. src/v2/streamlit_app_modified.py +32 -32
src/v2/streamlit_app_modified.py CHANGED
@@ -50,45 +50,45 @@ if notebook:
50
 
51
  results_tab, grammar_tab = st.tabs(['Execution', 'Grammar/Fact'])
52
 
53
- with results_tab:
54
- with st.spinner("πŸ”„ Executing notebook..."):
55
- try:
56
- notebook_dir_path = Path("/tmp/Notebook")
57
- notebook_files = [f for f in notebook_dir_path.iterdir() if f.suffix == '.ipynb']
58
 
59
- if not notebook_files:
60
- st.error("No notebook found in directory")
61
- else:
62
- notebook_path = notebook_files[0]
63
- st.write(f'πŸš€ Processing notebook: {notebook_path.name}')
64
 
65
- # Show available datasets
66
- dataset_files = [f for f in notebook_dir_path.iterdir()
67
- if f.suffix.lower() in ['.csv', '.xlsx', '.xls', '.json', '.txt', '.parquet']]
68
 
69
- if dataset_files:
70
- st.info(f"πŸ“ Available datasets: {', '.join([f.name for f in dataset_files])}")
71
 
72
- results = main_call(notebook_path)
73
 
74
- # Display results in a more user-friendly way
75
- if isinstance(results, dict):
76
- col1, col2 = st.columns([1, 3])
77
- with col1:
78
- if results['status'] == 'Pass':
79
- st.success("βœ… **Status: PASSED**")
80
- else:
81
- st.error("❌ **Status: FAILED**")
82
 
83
- with col2:
84
- st.write(f"**Notebook:** {results['notebook']}")
85
- if results['error_message']:
86
- st.error(f"**Error:** {results['error_message']}")
87
- else:
88
- st.dataframe(results)
89
 
90
- except Exception as e:
91
- st.error(f"❌ Error processing notebook: {str(e)}")
92
 
93
  with grammar_tab:
94
  try:
 
50
 
51
  results_tab, grammar_tab = st.tabs(['Execution', 'Grammar/Fact'])
52
 
53
+ # with results_tab:
54
+ # with st.spinner("πŸ”„ Executing notebook..."):
55
+ # try:
56
+ # notebook_dir_path = Path("/tmp/Notebook")
57
+ # notebook_files = [f for f in notebook_dir_path.iterdir() if f.suffix == '.ipynb']
58
 
59
+ # if not notebook_files:
60
+ # st.error("No notebook found in directory")
61
+ # else:
62
+ # notebook_path = notebook_files[0]
63
+ # st.write(f'πŸš€ Processing notebook: {notebook_path.name}')
64
 
65
+ # # Show available datasets
66
+ # dataset_files = [f for f in notebook_dir_path.iterdir()
67
+ # if f.suffix.lower() in ['.csv', '.xlsx', '.xls', '.json', '.txt', '.parquet']]
68
 
69
+ # if dataset_files:
70
+ # st.info(f"πŸ“ Available datasets: {', '.join([f.name for f in dataset_files])}")
71
 
72
+ # results = main_call(notebook_path)
73
 
74
+ # # Display results in a more user-friendly way
75
+ # if isinstance(results, dict):
76
+ # col1, col2 = st.columns([1, 3])
77
+ # with col1:
78
+ # if results['status'] == 'Pass':
79
+ # st.success("βœ… **Status: PASSED**")
80
+ # else:
81
+ # st.error("❌ **Status: FAILED**")
82
 
83
+ # with col2:
84
+ # st.write(f"**Notebook:** {results['notebook']}")
85
+ # if results['error_message']:
86
+ # st.error(f"**Error:** {results['error_message']}")
87
+ # else:
88
+ # st.dataframe(results)
89
 
90
+ # except Exception as e:
91
+ # st.error(f"❌ Error processing notebook: {str(e)}")
92
 
93
  with grammar_tab:
94
  try: