Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,31 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
4 |
with gr.Sidebar():
|
5 |
-
gr.Markdown("
|
6 |
-
gr.Markdown(
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Step 1: Improved layout and clean sidebar
|
2 |
import gradio as gr
|
3 |
|
4 |
+
MODEL_ID = "Salesforce/codet5-large"
|
5 |
+
|
6 |
+
with gr.Blocks(fill_height=True, theme=gr.themes.Soft()) as demo:
|
7 |
with gr.Sidebar():
|
8 |
+
gr.Markdown("## 🤖 Inference Provider")
|
9 |
+
gr.Markdown(
|
10 |
+
f"This Space showcases the `{MODEL_ID}` model, served via the Hugging Face Inference API.\n\n"
|
11 |
+
"🔐 Sign in with your Hugging Face account to use this API."
|
12 |
+
)
|
13 |
+
login_button = gr.LoginButton("🔐 Sign in")
|
14 |
+
|
15 |
+
gr.Markdown("---")
|
16 |
+
gr.Markdown(f"**Model:** `{MODEL_ID}`")
|
17 |
+
gr.Markdown("[📄 View Model Card](https://huggingface.co/Salesforce/codet5-large)")
|
18 |
+
|
19 |
+
gr.Markdown("# 🧠 CodeT5 Inference UI")
|
20 |
+
|
21 |
+
# Placeholder: we'll add inputs, buttons, outputs in next steps
|
22 |
+
gr.Markdown("_Interface under construction..._")
|
23 |
+
|
24 |
+
# Load HF inference API model
|
25 |
+
gr.load(
|
26 |
+
f"models/{MODEL_ID}",
|
27 |
+
accept_token=login_button,
|
28 |
+
provider="hf-inference"
|
29 |
+
)
|
30 |
+
|
31 |
+
demo.launch()
|