Spaces:
Running
Running
Download verify_gemini.py from H3y-sam/Telegram-Bot: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/H3y-sam/Telegram-Bot/resolve/main/verify_gemini.py
- Command line
-
hf download hf://spaces/H3y-sam/Telegram-Bot/verify_gemini.py
-
curl -L -o verify_gemini.py https://huggingface.co/spaces/H3y-sam/Telegram-Bot/resolve/main/verify_gemini.py
1.01 kB
| import os | |
| import sys | |
| from dotenv import load_dotenv | |
| # Ensure packages are findable | |
| sys.path.append(os.getcwd()) | |
| load_dotenv() | |
| import asyncio | |
| from content.generator import generate_content | |
| print("Testing content generation with Groq...") | |
| try: | |
| # Attempt to generate a PYQ for jee_main | |
| result = asyncio.run(generate_content("pyq_question", "jee_main")) | |
| if isinstance(result, dict) and ("error" in result or "⚠️" in str(result)): | |
| print("❌ Generation failed. Check logs.") | |
| print(result) | |
| elif isinstance(result, str) and ("⚠️" in result or "❌" in result): | |
| print("❌ Generation failed. Check logs.") | |
| print(result) | |
| else: | |
| print("✅ Groq generation successful!") | |
| print("-" * 30) | |
| # Print string or text content of dict | |
| text_content = result.get("text", str(result)) if isinstance(result, dict) else result | |
| print(text_content[:300] + "...") | |
| except Exception as e: | |
| print(f"❌ Critical error during test: {e}") | |