import gradio as gr from huggingface_hub import InferenceClient client = InferenceClient(model="codellama/CodeLlama-7b-Instruct-hf") def explain_code(code): response = client.text_generation( prompt=f"Explain this code:\n\n{code}", max_new_tokens=200, temperature=0.7 ) return response demo = gr.Interface( fn=explain_code, inputs=gr.Textbox(lines=10, placeholder="Paste your code here...", label="Code"), outputs="textbox", title="🧠 IHCP Code Agent", description="Explains React, Python, or Solidity code using CodeLlama via Hugging Face Inference API." ) demo.launch()