hassoudi commited on
Commit
6a362a8
·
verified ·
1 Parent(s): 5c6714e

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,4 +1,5 @@
1
  from fastapi import FastAPI, Depends, HTTPException, Request
 
2
  from fastapi.security import APIKeyHeader
3
  from pydantic import BaseModel
4
  from model import ner_pipeline
@@ -100,15 +101,15 @@ def list_users(x_api_key: str = Depends(token_header)):
100
  raise HTTPException(status_code=403, detail="Admin access required")
101
  return {"users": API_KEYS}
102
 
 
103
  @app.get("/", include_in_schema=False)
104
  def root():
105
  return HTMLResponse("""
106
  <html>
107
- <head><title>MagBERT-NER API</title></head>
108
- <body style="font-family:sans-serif;">
109
- <h1>✅ MagBERT-NER API is running!</h1>
110
- <p>This is a private FastAPI app.</p>
111
- <p>Visit <a href="/docs">/docs</a> to explore the API interface.</p>
112
  </body>
113
  </html>
114
  """)
 
1
  from fastapi import FastAPI, Depends, HTTPException, Request
2
+ from fastapi.responses import HTMLResponse # ✅ Add this line
3
  from fastapi.security import APIKeyHeader
4
  from pydantic import BaseModel
5
  from model import ner_pipeline
 
101
  raise HTTPException(status_code=403, detail="Admin access required")
102
  return {"users": API_KEYS}
103
 
104
+
105
  @app.get("/", include_in_schema=False)
106
  def root():
107
  return HTMLResponse("""
108
  <html>
109
+ <head><title>NER API</title></head>
110
+ <body>
111
+ <h1>✅ NER API is running!</h1>
112
+ <p>Visit <a href='/docs'>/docs</a> to try the API.</p>
 
113
  </body>
114
  </html>
115
  """)