hackergeek commited on
Commit
ca06a2f
·
verified ·
1 Parent(s): 258ba22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -1,10 +1,21 @@
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 microsoft/phi-4 model, served by the nebius API. Sign in with your Hugging Face account to use this API.")
7
  button = gr.LoginButton("Sign in")
8
- gr.load("models/microsoft/phi-4", accept_token=button, provider="nebius")
9
 
 
 
 
 
 
 
 
10
  demo.launch()
 
1
  import gradio as gr
2
 
3
+ def process_file(file):
4
+ # Process the uploaded file here
5
+ # For demonstration, we'll just return the file name
6
+ return f"Uploaded file: {file.name}"
7
+
8
  with gr.Blocks(fill_height=True) as demo:
9
  with gr.Sidebar():
10
  gr.Markdown("# Inference Provider")
11
  gr.Markdown("This Space showcases the microsoft/phi-4 model, served by the nebius API. Sign in with your Hugging Face account to use this API.")
12
  button = gr.LoginButton("Sign in")
 
13
 
14
+ with gr.Column():
15
+ gr.load("models/microsoft/phi-4", accept_token=button, provider="nebius")
16
+ file_input = gr.File(label="Upload a file")
17
+ file_output = gr.Textbox(label="File Info")
18
+
19
+ file_input.change(process_file, inputs=file_input, outputs=file_output)
20
+
21
  demo.launch()