PraneshJs commited on
Commit
0e76afd
·
verified ·
1 Parent(s): 8032137

Changed file opening logic for model.onnx and class_names.txt

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 = os.path.join(os.path.dirname(__file__), '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 = os.path.join(os.path.dirname(__file__), 'model.onnx')
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 ===