AbuAlone09 commited on
Commit
10153f7
·
verified ·
1 Parent(s): ec7c4de

Update backend_api.py

Browse files
Files changed (1) hide show
  1. backend_api.py +16 -0
backend_api.py CHANGED
@@ -844,6 +844,22 @@ async def generate_code(
844
  {"role": "system", "content": system_prompt},
845
  {"role": "user", "content": user_content}
846
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
847
 
848
  # ... (Các phần khởi tạo trước đó giữ nguyên)
849
 
 
844
  {"role": "system", "content": system_prompt},
845
  {"role": "user", "content": user_content}
846
  ]
847
+
848
+ # DEBUG LOGGING (Thêm đoạn này để xem nó đang gọi cái gì)
849
+ print(f"[DEBUG] Selected Model ID: {selected_model_id}")
850
+ print(f"[DEBUG] Actual Model ID: {actual_model_id}")
851
+ print(f"[DEBUG] Client Type: {type(client)}")
852
+
853
+ # Kiểm tra nếu client thuộc dạng HuggingFace InferenceClient
854
+ if hasattr(client, 'model'):
855
+ print(f"[DEBUG] Client is using model: {client.model}")
856
+
857
+ # GỌI GEMINI (Đảm bảo gọi đúng client)
858
+ try:
859
+ # Nếu client là Gemini Model, nó có phương thức generate_content
860
+ # Nếu là HF Client, nó sẽ có phương thức khác
861
+ print("[DEBUG] Attempting to generate content...")
862
+
863
 
864
  # ... (Các phần khởi tạo trước đó giữ nguyên)
865