setup model initialization
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ async def process_pdf(
|
|
| 35 |
raise HTTPException(status_code=401, detail="Invalid API key")
|
| 36 |
|
| 37 |
# Connect to RabbitMQ
|
| 38 |
-
rabbit_url = os.getenv("RABBITMQ_URL"
|
| 39 |
connection = pika.BlockingConnection(pika.URLParameters(rabbit_url))
|
| 40 |
channel = connection.channel()
|
| 41 |
channel.queue_declare(queue="ml_server", durable=True)
|
|
|
|
| 35 |
raise HTTPException(status_code=401, detail="Invalid API key")
|
| 36 |
|
| 37 |
# Connect to RabbitMQ
|
| 38 |
+
rabbit_url = os.getenv("RABBITMQ_URL")
|
| 39 |
connection = pika.BlockingConnection(pika.URLParameters(rabbit_url))
|
| 40 |
channel = connection.channel()
|
| 41 |
channel.queue_declare(queue="ml_server", durable=True)
|
launch.sh
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
echo "Setting up requirements"
|
| 3 |
+
|
| 4 |
+
python download_models_hf.py
|
| 5 |
+
|
| 6 |
+
python app.py # or uvicorn app:app --host 0.0.0.0 --port 7860
|