diazcalvi commited on
Commit
8a6be4d
·
1 Parent(s): f2f0f51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -109,5 +109,17 @@ if index is None:
109
  st.warning("Please enter your api key first.")
110
 
111
 
112
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
113
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  st.warning("Please enter your api key first.")
110
 
111
 
112
+
113
+ gradio_interface = gradio.Interface(
114
+ fn=greet,
115
+ inputs="text",
116
+ outputs="text",
117
+ examples=[
118
+ ["What is the track width of the P30 (b11 mm)?"],
119
+ ["What is the acceleration of the P30 (km/h)?"]
120
+ ],
121
+ title="REST API with Gradio and Huggingface Spaces",
122
+ 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.",
123
+ article="© Tom Söderlund 2022"
124
+ )
125
+ gradio_interface.launch()