Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,19 @@
|
|
| 1 |
-
import sys
|
| 2 |
import os
|
|
|
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
import gradio as gr
|
|
|
|
| 8 |
from scripts.codeforces_sync import run_cf_sync
|
| 9 |
from scripts.leetcode_fetch import run_lc_sync
|
| 10 |
|
|
|
|
|
|
|
| 11 |
def handle_cf():
|
| 12 |
# Calling the function from our script
|
| 13 |
return run_cf_sync()
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
import sys
|
| 3 |
|
| 4 |
+
# Get the absolute path of the directory containing app.py
|
| 5 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 6 |
+
# Add it to the system path
|
| 7 |
+
if current_dir not in sys.path:
|
| 8 |
+
sys.path.insert(0, current_dir)
|
| 9 |
|
| 10 |
import gradio as gr
|
| 11 |
+
# Now the imports should work
|
| 12 |
from scripts.codeforces_sync import run_cf_sync
|
| 13 |
from scripts.leetcode_fetch import run_lc_sync
|
| 14 |
|
| 15 |
+
# ... rest of your Gradio code ...
|
| 16 |
+
|
| 17 |
def handle_cf():
|
| 18 |
# Calling the function from our script
|
| 19 |
return run_cf_sync()
|