Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -887,7 +887,6 @@ Example: 'Received {total_slides} slides, {total_slides} scripts, and HTML files
|
|
| 887 |
# custom js for lecture container features
|
| 888 |
js_code = """
|
| 889 |
() => {
|
| 890 |
-
// Function to wait for an element to appear in the DOM
|
| 891 |
function waitForElement(selector, callback, maxAttempts = 50, interval = 100) {
|
| 892 |
let attempts = 0;
|
| 893 |
const intervalId = setInterval(() => {
|
|
@@ -904,11 +903,11 @@ js_code = """
|
|
| 904 |
}, interval);
|
| 905 |
}
|
| 906 |
|
| 907 |
-
// Main
|
| 908 |
function initializeSlides() {
|
| 909 |
console.log("Initializing slides...");
|
| 910 |
|
| 911 |
-
//
|
| 912 |
waitForElement('#lecture-data', (dataElement) => {
|
| 913 |
if (!dataElement.textContent) {
|
| 914 |
console.error("Lecture data element is empty");
|
|
@@ -1251,8 +1250,7 @@ with gr.Blocks(
|
|
| 1251 |
head='<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">'
|
| 1252 |
) as demo:
|
| 1253 |
gr.Markdown("""
|
| 1254 |
-
# <center>Professor AI Feynman: A Multi-Agent Tool for Learning Anything the Feynman way.</center>
|
| 1255 |
-
## <center>(Jaward Sesay - Microsoft AI Agent Hackathon Submission)</center>""")
|
| 1256 |
with gr.Row():
|
| 1257 |
with gr.Column(scale=1):
|
| 1258 |
with gr.Group(elem_id="form-group"):
|
|
|
|
| 887 |
# custom js for lecture container features
|
| 888 |
js_code = """
|
| 889 |
() => {
|
|
|
|
| 890 |
function waitForElement(selector, callback, maxAttempts = 50, interval = 100) {
|
| 891 |
let attempts = 0;
|
| 892 |
const intervalId = setInterval(() => {
|
|
|
|
| 903 |
}, interval);
|
| 904 |
}
|
| 905 |
|
| 906 |
+
// Main initit func
|
| 907 |
function initializeSlides() {
|
| 908 |
console.log("Initializing slides...");
|
| 909 |
|
| 910 |
+
// await lecture-data to load JSON data
|
| 911 |
waitForElement('#lecture-data', (dataElement) => {
|
| 912 |
if (!dataElement.textContent) {
|
| 913 |
console.error("Lecture data element is empty");
|
|
|
|
| 1250 |
head='<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">'
|
| 1251 |
) as demo:
|
| 1252 |
gr.Markdown("""
|
| 1253 |
+
# <center>Professor AI Feynman: A Multi-Agent Tool for Learning Anything the Feynman way.</center>""")
|
|
|
|
| 1254 |
with gr.Row():
|
| 1255 |
with gr.Column(scale=1):
|
| 1256 |
with gr.Group(elem_id="form-group"):
|