Spaces:
Sleeping
Sleeping
Update src/sql_generator.py
Browse files8 unmodified lines91011121314151617181920218 unmodified linesload_dotenv()# 1. ROBUSTLY FETCH & CLEAN THE KEY# We use .strip() to remove the accidental '\n' (newline) causing your errorraw_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 Coderself.repo_id = "Qwen/Qwen2.5-Coder-32B-Instruct"self.api_url = f"https://api-inference.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"]8 unmodified lines9101112131415161718192021228 unmodified linesload_dotenv()# 1. ROBUSTLY FETCH & CLEAN THE KEYraw_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 Coderself.repo_id = "Qwen/Qwen2.5-Coder-32B-Instruct"# ✅ FIX: Updated to the new Hugging Face Router URLself.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