Spaces:
Sleeping
Sleeping
Commit ·
6d2662e
1
Parent(s): adb85eb
Update greeting
Browse files
app.py
CHANGED
|
@@ -1,18 +1,20 @@
|
|
| 1 |
import gradio
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
|
| 6 |
gradio_interface = gradio.Interface(
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
)
|
| 18 |
gradio_interface.launch()
|
|
|
|
| 1 |
import gradio
|
| 2 |
|
| 3 |
+
|
| 4 |
+
def main(name):
|
| 5 |
+
return "Buenos días " + name + "!"
|
| 6 |
+
|
| 7 |
|
| 8 |
gradio_interface = gradio.Interface(
|
| 9 |
+
fn=main,
|
| 10 |
+
inputs="text",
|
| 11 |
+
outputs="text",
|
| 12 |
+
examples=[
|
| 13 |
+
["Jill"],
|
| 14 |
+
["Sam"]
|
| 15 |
+
],
|
| 16 |
+
title="REST API with Gradio and Huggingface Spaces",
|
| 17 |
+
description="This is a demo of how to build an AI powered REST API with Gradio and Huggingface Spaces – for free! Based on [this article](https://www.tomsoderlund.com/ai/building-ai-powered-rest-api). See the **Use via API** link at the bottom of this page.",
|
| 18 |
+
article="© Tom Söderlund 2022"
|
| 19 |
)
|
| 20 |
gradio_interface.launch()
|