Spaces:
Sleeping
Sleeping
Changed file opening logic for model.onnx and class_names.txt
Browse files
app.py
CHANGED
|
@@ -11,13 +11,13 @@ from openai import OpenAI
|
|
| 11 |
load_dotenv()
|
| 12 |
|
| 13 |
# === Load and clean class names ===
|
| 14 |
-
class_file_path =
|
| 15 |
-
with open(class_file_path,
|
| 16 |
raw_line = f.read()
|
| 17 |
class_names = ast.literal_eval(raw_line.replace("Classes: ", "").strip())
|
| 18 |
|
| 19 |
# === Load ONNX model ===
|
| 20 |
-
model_path =
|
| 21 |
learn = ort.InferenceSession(model_path)
|
| 22 |
|
| 23 |
# === OpenRouter setup ===
|
|
|
|
| 11 |
load_dotenv()
|
| 12 |
|
| 13 |
# === Load and clean class names ===
|
| 14 |
+
class_file_path = "class_names.txt"
|
| 15 |
+
with open(class_file_path, "r") as f:
|
| 16 |
raw_line = f.read()
|
| 17 |
class_names = ast.literal_eval(raw_line.replace("Classes: ", "").strip())
|
| 18 |
|
| 19 |
# === Load ONNX model ===
|
| 20 |
+
model_path = "model.onnx"
|
| 21 |
learn = ort.InferenceSession(model_path)
|
| 22 |
|
| 23 |
# === OpenRouter setup ===
|