Bennie12 commited on
Commit
b08d402
ยท
verified ยท
1 Parent(s): bcf09d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 uvicorn
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