Create app_simple.py
Browse files- app_simple.py +17 -0
app_simple.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from huggingface_hub import from_pretrained
|
3 |
+
|
4 |
+
# Load the model (try with a built-in model first)
|
5 |
+
model = from_pretrained("bert-base-uncased") # Or any other built-in HF model
|
6 |
+
|
7 |
+
def predict_simple(text):
|
8 |
+
return {"result": text.upper()}
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=predict_simple,
|
12 |
+
inputs="text",
|
13 |
+
outputs="text",
|
14 |
+
title="Simple Text Uppercasing",
|
15 |
+
)
|
16 |
+
|
17 |
+
iface.launch()
|