Spaces:
Running
Running
Commit ·
32ff648
1
Parent(s): 2b9263c
remove weird stuff
Browse files
app.py
CHANGED
|
@@ -1,12 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import importlib.util
|
| 3 |
-
import os
|
| 4 |
import json
|
| 5 |
import torch
|
| 6 |
import gc
|
| 7 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 8 |
from functools import wraps
|
| 9 |
-
import signal
|
| 10 |
import threading
|
| 11 |
import sys
|
| 12 |
import argparse
|
|
@@ -165,23 +163,7 @@ def evaluate_submission(file_obj, debug=False):
|
|
| 165 |
print(f"\n{'='*60}")
|
| 166 |
print(f"EVALUATING: {file_path}")
|
| 167 |
print(f"{'='*60}\n")
|
| 168 |
-
|
| 169 |
-
# Clear any cached bytecode to avoid unmarshallable object errors
|
| 170 |
-
import sys
|
| 171 |
-
import pathlib
|
| 172 |
-
if file_path in sys.modules:
|
| 173 |
-
del sys.modules[file_path]
|
| 174 |
-
|
| 175 |
-
# Remove .pyc files if they exist
|
| 176 |
-
py_file = pathlib.Path(file_path)
|
| 177 |
-
pycache_dir = py_file.parent / '__pycache__'
|
| 178 |
-
if pycache_dir.exists():
|
| 179 |
-
for pyc_file in pycache_dir.glob(f'{py_file.stem}*.pyc'):
|
| 180 |
-
try:
|
| 181 |
-
pyc_file.unlink()
|
| 182 |
-
except:
|
| 183 |
-
pass
|
| 184 |
-
|
| 185 |
# Import with a unique module name each time
|
| 186 |
import time
|
| 187 |
module_name = f"student_module_{int(time.time() * 1000000)}"
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import importlib.util
|
|
|
|
| 3 |
import json
|
| 4 |
import torch
|
| 5 |
import gc
|
| 6 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 7 |
from functools import wraps
|
|
|
|
| 8 |
import threading
|
| 9 |
import sys
|
| 10 |
import argparse
|
|
|
|
| 163 |
print(f"\n{'='*60}")
|
| 164 |
print(f"EVALUATING: {file_path}")
|
| 165 |
print(f"{'='*60}\n")
|
| 166 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
# Import with a unique module name each time
|
| 168 |
import time
|
| 169 |
module_name = f"student_module_{int(time.time() * 1000000)}"
|