Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from bert_explainer import analyze_text, analyze_image
|
| 3 |
import fastapi
|
| 4 |
-
import
|
| 5 |
|
| 6 |
# โณ ๅๆๆๅญ
|
| 7 |
def predict_text(text, mode):
|
|
@@ -46,9 +45,10 @@ image_api = gr.Interface(
|
|
| 46 |
flagging_mode="never"
|
| 47 |
)
|
| 48 |
|
| 49 |
-
# ๐ FastAPI
|
| 50 |
app = fastapi.FastAPI()
|
| 51 |
app = gr.mount_gradio_app(app, text_api, path="/run/predict_text")
|
| 52 |
app = gr.mount_gradio_app(app, image_api, path="/run/predict_image")
|
| 53 |
|
|
|
|
| 54 |
demo = text_api
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import fastapi
|
| 3 |
+
from bert_explainer import analyze_text, analyze_image
|
| 4 |
|
| 5 |
# โณ ๅๆๆๅญ
|
| 6 |
def predict_text(text, mode):
|
|
|
|
| 45 |
flagging_mode="never"
|
| 46 |
)
|
| 47 |
|
| 48 |
+
# ๐ FastAPI ไธปๆ็จ
|
| 49 |
app = fastapi.FastAPI()
|
| 50 |
app = gr.mount_gradio_app(app, text_api, path="/run/predict_text")
|
| 51 |
app = gr.mount_gradio_app(app, image_api, path="/run/predict_image")
|
| 52 |
|
| 53 |
+
# โ
่ฎ Hugging Face ็ๆ /view=api ๆไปถ้
|
| 54 |
demo = text_api
|