File size: 1,014 Bytes
99f19f2
920c424
 
99f19f2
 
 
920c424
99f19f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Step 1: Improved layout and clean sidebar
import gradio as gr

MODEL_ID = "Salesforce/codet5-large"

with gr.Blocks(fill_height=True, theme=gr.themes.Soft()) as demo:
    with gr.Sidebar():
        gr.Markdown("## 🤖 Inference Provider")
        gr.Markdown(
            f"This Space showcases the `{MODEL_ID}` model, served via the Hugging Face Inference API.\n\n"
            "🔐 Sign in with your Hugging Face account to use this API."
        )
        login_button = gr.LoginButton("🔐 Sign in")

        gr.Markdown("---")
        gr.Markdown(f"**Model:** `{MODEL_ID}`")
        gr.Markdown("[📄 View Model Card](https://huggingface.co/Salesforce/codet5-large)")

    gr.Markdown("# 🧠 CodeT5 Inference UI")

    # Placeholder: we'll add inputs, buttons, outputs in next steps
    gr.Markdown("_Interface under construction..._")

    # Load HF inference API model
    gr.load(
        f"models/{MODEL_ID}",
        accept_token=login_button,
        provider="hf-inference"
    )

demo.launch()