feat: update
Browse files- __pycache__/app.cpython-310.pyc +0 -0
- api.py +12 -0
- app.py +12 -0
- requirements.txt +2 -0
__pycache__/app.cpython-310.pyc
ADDED
Binary file (358 Bytes). View file
|
|
api.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
|
3 |
+
app = FastAPI()
|
4 |
+
|
5 |
+
@app.get("/")
|
6 |
+
def read_root():
|
7 |
+
return "Hello, World!"
|
8 |
+
|
9 |
+
|
10 |
+
if __name__ == "__main__":
|
11 |
+
import uvicorn
|
12 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
def greet(name='World'):
|
4 |
+
url = 'http://localhost:8000/'
|
5 |
+
raw_response = requests.get(url)
|
6 |
+
return raw_response.text
|
7 |
+
|
8 |
+
import subprocess
|
9 |
+
subprocess.Popen("python api.py", shell=True)
|
10 |
+
|
11 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
12 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
flask
|
2 |
+
fastapi
|