princhman commited on
Commit
6fb5929
·
2 Parent(s): 9d76b0f a7e16c8

setup model initialization

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. launch.sh +6 -0
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", "amqp://guest:guest@localhost:5672/")
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