Spaces:
Sleeping
Sleeping
Update src/sql_generator.py
Browse files8 unmodified lines91011121213141516171818192021228 unmodified lines load_dotenv() # 1. ROBUSTLY FETCH & CLEAN THE KEY # We use .strip() to remove the accidental '\n' (newline) causing your error raw_key = os.getenv("HF_API_KEY") or os.getenv("HUGGINGFACEHUB_API_TOKEN") self.api_key = raw_key.strip() if raw_key else None # 2. Use Qwen 2.5 Coder self.repo_id = "Qwen/Qwen2.5-Coder-32B-Instruct" # ✅ FIX: Updated to the new Hugging Face Router URL self.api_url = f"https://api-inference.huggingface.co/models/{self.repo_id}" self.api_url = f"https://router.huggingface.co/models/{self.repo_id}"
def generate_followup_questions(self, question, sql_query): return ["Visualize this result", "Export as CSV", "Compare with last year"]src/sql_generator.py+3-2