Spaces:
Build error
Build error
Ilia Tambovtsev commited on
Commit ·
fdfe2ec
1
Parent(s): 99f57b8
feat: implement load collection from dotenv in webapp
Browse files- src/webapp/app.py +5 -3
src/webapp/app.py
CHANGED
|
@@ -246,7 +246,6 @@ class RagInterface:
|
|
| 246 |
outputs=result_components,
|
| 247 |
)
|
| 248 |
|
| 249 |
-
|
| 250 |
app.launch(ssr_mode=False, **kwargs)
|
| 251 |
|
| 252 |
|
|
@@ -276,10 +275,13 @@ def main():
|
|
| 276 |
parser.add_argument("--share", action="store_true", help="Create public link")
|
| 277 |
args = parser.parse_args()
|
| 278 |
|
| 279 |
-
|
|
|
|
| 280 |
|
| 281 |
# Initialize store
|
| 282 |
-
store = ChromaSlideStore(
|
|
|
|
|
|
|
| 283 |
|
| 284 |
# Run app
|
| 285 |
run_app(store, server_name=args.host, server_port=args.port, share=args.share)
|
|
|
|
| 246 |
outputs=result_components,
|
| 247 |
)
|
| 248 |
|
|
|
|
| 249 |
app.launch(ssr_mode=False, **kwargs)
|
| 250 |
|
| 251 |
|
|
|
|
| 275 |
parser.add_argument("--share", action="store_true", help="Create public link")
|
| 276 |
args = parser.parse_args()
|
| 277 |
|
| 278 |
+
# Load collection from dotenv if not specified
|
| 279 |
+
collection = os.getenv("CHROMA_COLLECTION_NAME") or args.collection
|
| 280 |
|
| 281 |
# Initialize store
|
| 282 |
+
store = ChromaSlideStore(
|
| 283 |
+
collection_name=collection
|
| 284 |
+
) # pyright: ignore[reportArgumentType]
|
| 285 |
|
| 286 |
# Run app
|
| 287 |
run_app(store, server_name=args.host, server_port=args.port, share=args.share)
|