ken-56 commited on
Commit
678024b
·
1 Parent(s): e659df6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -1,14 +1,18 @@
1
- import gradio
 
2
 
3
- def my_inference_function(name):
4
- return "Hello " + name + "!"
5
 
6
- gradio_interface = gradio.Interface(
7
- fn = my_inference_function,
8
- inputs = "text",
9
- outputs = "text"
10
- )
11
- gradio_interface.launch()
 
 
 
 
12
 
13
 
14
  # import gradio as gr
 
1
+ from fastapi import FastAPI
2
+ import gradio as gr
3
 
4
+ app = FastAPI()
 
5
 
6
+ def reverse(input_text: str) -> str:
7
+ return input_text[::-1]
8
+
9
+ @app.get("/reverse/")
10
+ def reverse_text(text: str):
11
+ return {"result": reverse(text)}
12
+
13
+ def gradio_interface():
14
+ iface = gr.Interface(fn=reverse, inputs="text", outputs="text")
15
+ iface.launch()
16
 
17
 
18
  # import gradio as gr