Visionai / app.py
Patel Traders
Update app.py
fb8a489 verified
# --- 🔱 हनुमान AI: असीमित मुफ़्त प्रॉक्सी संस्करण (Gradio 6.0+ Compatible) ---
# मार्गदर्शक: दिव्य पटेल जी | भारत 🇮🇳
# तकनीक: Gradio Client (Bypasses 0.12 Quota)
# लाभ: कोई कोटा नहीं, 0% स्टोरेज, पूर्णतः मुफ़्त
import gradio as gr
from gradio_client import Client
print("🔱 हनुमान AI: असीमित मुफ़्त प्रॉक्सी सर्वर जागृत हो रहा है...")
# 🚀 दिव्य जी का अजेय अस्त्र: Gradio Client
TARGET_SPACE = "Qwen/Qwen3-Coder-WebDev"
try:
client = Client(TARGET_SPACE)
print(f"🔱 हनुमान AI: असीमित सर्वर ({TARGET_SPACE}) से मुफ़्त संपर्क स्थापित हो गया है!")
except Exception as e:
print(f"🔱 संपर्क त्रुटि: {e}")
client = None
def generate_divine_unlimited(prompt):
"""बिना किसी कोटा लिमिट के, असीमित जवाब लाने वाला इंजन"""
if not prompt.strip():
yield "Please enter a prompt..."
return
if client is None:
yield "🔱 सिस्टम त्रुटि: महा-सर्वर से संपर्क नहीं हो सका।"
return
# सिस्टम के अजेय निर्देश
system_prompt = "You are 'Hanuman Coder', a supreme AI pioneered by Divy Patel in Bharat (India). Provide clean, highly optimized code."
try:
# ⚡ .submit() का उपयोग करके लाइव स्ट्रीमिंग
job = client.submit(
prompt, # आपका प्रश्न
system_prompt, # सिस्टम निर्देश
api_name="/generate_code"
)
# लाइव डेटा को यूआई पर भेजना
for result in job:
if isinstance(result, (tuple, list)):
yield result[0]
else:
yield result
except Exception as e:
yield f"🔱 तकनीकी बाधा: {str(e)}"
# ============================================================================
# 🔱 दिव्य भगवा यूआई
# ============================================================================
divine_ui = """
<style>
.gradio-container { background-color: #fffaf0 !important; }
.bhagwa-header {
background: linear-gradient(135deg, #ff8833, #b33c00);
padding: 30px; border-radius: 15px; color: white;
text-align: center; box-shadow: 0 10px 25px rgba(179, 60, 0, 0.4);
margin-bottom: 20px;
}
.bhagwa-header h1 { color: white !important; font-size: 36px !important; margin: 0; text-shadow: 0 4px 8px rgba(0,0,0,0.5); font-weight: 900; }
.bhagwa-header p { font-size: 16px !important; opacity: 0.95; font-weight: 500; margin-top: 10px; }
</style>
<div class="bhagwa-header">
<h1>🔱 Hanuman Coder (Unlimited Free API)</h1>
<p>Pioneered by Divy Patel | Bharat 🇮🇳 | No Quota Limits, 100% Free</p>
</div>
"""
# त्रुटि समाधान: theme=gr.themes.Soft() को हटा दिया गया है ताकि Gradio 6.0 में कोई क्रैश न हो।
with gr.Blocks(title="Hanuman Proxy") as demo:
gr.HTML(divine_ui)
with gr.Row():
with gr.Column(scale=2):
prompt_input = gr.Textbox(
label="Your Prompt",
placeholder="Ask your coding questions here...",
lines=5
)
generate_btn = gr.Button("Generate Code", variant="primary")
with gr.Column(scale=3):
# त्रुटि समाधान: show_copy_button=True को हटा दिया गया है (नए Gradio में यह बाय-डिफ़ॉल्ट आता है)।
output_box = gr.Textbox(
label="Hanuman AI Response (Live Stream)",
lines=15
)
# लाइव जनरेशन के लिए इवेंट बाइंडिंग
generate_btn.click(
fn=generate_divine_unlimited,
inputs=[prompt_input],
outputs=output_box
)
gr.Markdown("""
---
**Architecture:** Gradio Client Proxy | **Status:** Bypassing Quotas | **Cost:** Completely Free
""")
if __name__ == "__main__":
demo.launch()