File size: 4,758 Bytes
fb8a489
99b0007
80c5b91
 
99b0007
 
0d61269
99b0007
80c5b91
9640a9d
80c5b91
 
99b0007
 
80c5b91
 
99b0007
0d61269
 
99b0007
80c5b91
 
bf38068
0d61269
bf38068
0d61269
 
80c5b91
bf38068
99b0007
0d61269
 
 
99b0007
fb8a489
0d61269
9640a9d
 
0d61269
 
 
80c5b91
0d61269
 
 
 
 
 
 
80c5b91
99b0007
bf38068
80c5b91
bf38068
99b0007
 
 
 
 
bf38068
99b0007
bf38068
99b0007
bf38068
 
99b0007
 
80c5b91
 
99b0007
 
 
fb8a489
 
99b0007
 
 
bf38068
b9a91fb
bf38068
80c5b91
0d61269
99b0007
0d61269
bf38068
 
fb8a489
bf38068
0d61269
fb8a489
bf38068
 
0d61269
bf38068
80c5b91
0d61269
bf38068
99b0007
bf38068
80c5b91
bf38068
80c5b91
bf38068
99b0007
 
bf38068
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# --- 🔱 हनुमान 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()