AnshulS commited on
Commit
35064d5
·
verified ·
1 Parent(s): 4bb759e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -16
app.py CHANGED
@@ -6,10 +6,9 @@ from fastapi.middleware.cors import CORSMiddleware
6
  import traceback
7
  from retriever import get_relevant_passages
8
  from reranker import rerank
9
- import os
10
 
11
  # Create FastAPI app
12
- app = FastAPI(root_path="")
13
 
14
  # Add CORS middleware
15
  app.add_middleware(
@@ -116,20 +115,8 @@ demo = gr.Interface(
116
  )
117
 
118
  # This is the pattern for Gradio 5.x
119
- #app = gr.mount_gradio_app(app, demo, path="/")
120
- if os.getenv("SPACE_ID"):
121
- # We're running on HF Spaces
122
- app = gr.mount_gradio_app(
123
- app,
124
- demo,
125
- path="/",
126
- app_kwargs={
127
- "root_path": ""
128
- }
129
- )
130
- else:
131
- # Local development
132
- app = gr.mount_gradio_app(app, demo, path="/")
133
  # Entry point
134
  if __name__ == "__main__":
135
  import uvicorn
 
6
  import traceback
7
  from retriever import get_relevant_passages
8
  from reranker import rerank
 
9
 
10
  # Create FastAPI app
11
+ app = FastAPI()
12
 
13
  # Add CORS middleware
14
  app.add_middleware(
 
115
  )
116
 
117
  # This is the pattern for Gradio 5.x
118
+ app = gr.mount_gradio_app(app, demo, path="/")
119
+
 
 
 
 
 
 
 
 
 
 
 
 
120
  # Entry point
121
  if __name__ == "__main__":
122
  import uvicorn