Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,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(
|
@@ -112,13 +112,30 @@ demo = gr.Interface(
|
|
112 |
outputs=gr.JSON(label="Recommended Assessments"),
|
113 |
title="SHL Assessment Recommender",
|
114 |
description="Paste a job description to get the most relevant SHL assessments.",
|
|
|
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
|
123 |
-
uvicorn.run(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
#app
|
|
|
8 |
from reranker import rerank
|
9 |
|
10 |
# Create FastAPI app
|
11 |
+
app = FastAPI(root_path="")
|
12 |
|
13 |
# Add CORS middleware
|
14 |
app.add_middleware(
|
|
|
112 |
outputs=gr.JSON(label="Recommended Assessments"),
|
113 |
title="SHL Assessment Recommender",
|
114 |
description="Paste a job description to get the most relevant SHL assessments.",
|
115 |
+
analytics_enabled=False,
|
116 |
)
|
117 |
|
118 |
# This is the pattern for Gradio 5.x
|
119 |
+
#app = gr.mount_gradio_app(app, demo, path="/")
|
120 |
+
app = gr.mount_gradio_app(
|
121 |
+
app,
|
122 |
+
demo,
|
123 |
+
path="/",
|
124 |
+
app_kwargs={
|
125 |
+
"ssl_verify": False, # Disable SSL verification for HF Spaces
|
126 |
+
"show_error": True, # Show detailed errors
|
127 |
+
}
|
128 |
+
)
|
129 |
# Entry point
|
130 |
if __name__ == "__main__":
|
131 |
import uvicorn
|
132 |
+
uvicorn.run(
|
133 |
+
app,
|
134 |
+
host="0.0.0.0",
|
135 |
+
port=7860,
|
136 |
+
log_level="info",
|
137 |
+
proxy_headers=True, # Process forwarded headers
|
138 |
+
forwarded_allow_ips="*" # Trust forwarded headers from any IP
|
139 |
+
)
|
140 |
+
#uvicorn.run(app, host="0.0.0.0", port=7860)
|
141 |
#app
|