microsoft-phi-4 / app.py
hackergeek's picture
Update app.py
ca06a2f verified
raw
history blame
794 Bytes
import gradio as gr
def process_file(file):
# Process the uploaded file here
# For demonstration, we'll just return the file name
return f"Uploaded file: {file.name}"
with gr.Blocks(fill_height=True) as demo:
with gr.Sidebar():
gr.Markdown("# Inference Provider")
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.")
button = gr.LoginButton("Sign in")
with gr.Column():
gr.load("models/microsoft/phi-4", accept_token=button, provider="nebius")
file_input = gr.File(label="Upload a file")
file_output = gr.Textbox(label="File Info")
file_input.change(process_file, inputs=file_input, outputs=file_output)
demo.launch()