S-Dreamer commited on
Commit
99f19f2
·
verified ·
1 Parent(s): eca329a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -7
app.py CHANGED
@@ -1,10 +1,31 @@
 
1
  import gradio as gr
2
 
3
- with gr.Blocks(fill_height=True) as demo:
 
 
4
  with gr.Sidebar():
5
- gr.Markdown("# Inference Provider")
6
- gr.Markdown("This Space showcases the Salesforce/codet5-large model, served by the hf-inference API. Sign in with your Hugging Face account to use this API.")
7
- button = gr.LoginButton("Sign in")
8
- gr.load("models/Salesforce/codet5-large", accept_token=button, provider="hf-inference")
9
-
10
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()