ProfessorCEO commited on
Commit
9a684ce
Β·
verified Β·
1 Parent(s): dd3182d

Upload gateway.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. gateway.py +25 -10
gateway.py CHANGED
@@ -52,21 +52,36 @@ import torch
52
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
53
 
54
  # -------------------------------------------------------------
55
- # Configuration & Model Resolution
56
  # -------------------------------------------------------------
57
- USB_MODEL_PATH = r"D:\kora_storage\coding_model\Qwen2.5-Coder-0.5B-Instruct"
58
- LOCAL_MODEL_PATH = r"models\coder\Qwen2.5-Coder-0.5B-Instruct"
59
-
60
- if os.path.exists(LOCAL_MODEL_PATH):
61
- CODER_MODEL_DIR = LOCAL_MODEL_PATH
62
- elif os.path.exists(USB_MODEL_PATH):
63
- CODER_MODEL_DIR = USB_MODEL_PATH
64
- else:
65
- CODER_MODEL_DIR = "Qwen/Qwen2.5-Coder-0.5B-Instruct"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  print("=" * 75, flush=True)
68
  print(" πŸš€ KORA UNIFIED CLOUD GATEWAY β€” KONTYRA AI ECOSYSTEM", flush=True)
69
  print(f" 🧠 Coder Engine: {CODER_MODEL_DIR}", flush=True)
 
70
  print("=" * 75, flush=True)
71
 
72
  # -------------------------------------------------------------
 
52
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
53
 
54
  # -------------------------------------------------------------
55
+ # Configuration & Model Resolution (Local USB & Storage Resolution)
56
  # -------------------------------------------------------------
57
+ USB_CODER_PATHS = [
58
+ r"D:\kora_storage\coding_model\Qwen2.5-Coder-0.5B-Instruct",
59
+ r"D:\kora_storage\models\coder\Qwen2.5-Coder-0.5B-Instruct",
60
+ r"models\coder\Qwen2.5-Coder-0.5B-Instruct"
61
+ ]
62
+
63
+ USB_CHAT_PATHS = [
64
+ r"D:\kora_storage\chat_model\Qwen2.5-0.5B-Instruct",
65
+ r"D:\kora_storage\models\chat\Qwen2.5-0.5B-Instruct",
66
+ r"models\chat\Qwen2.5-0.5B-Instruct"
67
+ ]
68
+
69
+ CODER_MODEL_DIR = "Qwen/Qwen2.5-Coder-0.5B-Instruct"
70
+ for p in USB_CODER_PATHS:
71
+ if os.path.exists(p):
72
+ CODER_MODEL_DIR = p
73
+ break
74
+
75
+ CHAT_MODEL_DIR = "Qwen/Qwen2.5-0.5B-Instruct"
76
+ for p in USB_CHAT_PATHS:
77
+ if os.path.exists(p):
78
+ CHAT_MODEL_DIR = p
79
+ break
80
 
81
  print("=" * 75, flush=True)
82
  print(" πŸš€ KORA UNIFIED CLOUD GATEWAY β€” KONTYRA AI ECOSYSTEM", flush=True)
83
  print(f" 🧠 Coder Engine: {CODER_MODEL_DIR}", flush=True)
84
+ print(f" πŸ’¬ Chat Engine: {CHAT_MODEL_DIR}", flush=True)
85
  print("=" * 75, flush=True)
86
 
87
  # -------------------------------------------------------------