Spaces:
Sleeping
Sleeping
- Dockerfile +1 -1
- docker-compose.yml +1 -3
- librarymed/app_librarymed.py +3 -3
- librarymed/main.py +0 -12
Dockerfile
CHANGED
@@ -41,4 +41,4 @@ EXPOSE 8080
|
|
41 |
ENV NAME World
|
42 |
|
43 |
# Command to run on container start
|
44 |
-
CMD [ "gunicorn", "
|
|
|
41 |
ENV NAME World
|
42 |
|
43 |
# Command to run on container start
|
44 |
+
CMD [ "gunicorn", "-b", "0.0.0.0:8080", "librarymed.app_librarymed:app" ]
|
docker-compose.yml
CHANGED
@@ -5,7 +5,5 @@ services:
|
|
5 |
build:
|
6 |
context: .
|
7 |
dockerfile: Dockerfile
|
8 |
-
volumes:
|
9 |
-
- .:/app
|
10 |
ports:
|
11 |
-
- "
|
|
|
5 |
build:
|
6 |
context: .
|
7 |
dockerfile: Dockerfile
|
|
|
|
|
8 |
ports:
|
9 |
+
- "8080:8080"
|
librarymed/app_librarymed.py
CHANGED
@@ -2,7 +2,7 @@ import logging
|
|
2 |
import os
|
3 |
|
4 |
import openai
|
5 |
-
from flask import Flask, flash, request,
|
6 |
from llama_index import Document
|
7 |
from llama_index.embeddings import OpenAIEmbedding, HuggingFaceEmbedding
|
8 |
from llama_index.llms import OpenAI
|
@@ -28,7 +28,7 @@ def allowed_file(filename, allowed_extensions):
|
|
28 |
|
29 |
|
30 |
@app.route('/', methods=['GET'])
|
31 |
-
def
|
32 |
score = 0
|
33 |
criteria_met = 0
|
34 |
title = ""
|
@@ -45,7 +45,7 @@ def __get__():
|
|
45 |
|
46 |
|
47 |
@app.route('/upload', methods=['POST'])
|
48 |
-
def
|
49 |
|
50 |
config = app.config['user_config']
|
51 |
openai.api_key = os.getenv('OPENAI_API_KEY')
|
|
|
2 |
import os
|
3 |
|
4 |
import openai
|
5 |
+
from flask import Flask, flash, request, jsonify
|
6 |
from llama_index import Document
|
7 |
from llama_index.embeddings import OpenAIEmbedding, HuggingFaceEmbedding
|
8 |
from llama_index.llms import OpenAI
|
|
|
28 |
|
29 |
|
30 |
@app.route('/', methods=['GET'])
|
31 |
+
def get():
|
32 |
score = 0
|
33 |
criteria_met = 0
|
34 |
title = ""
|
|
|
45 |
|
46 |
|
47 |
@app.route('/upload', methods=['POST'])
|
48 |
+
def post():
|
49 |
|
50 |
config = app.config['user_config']
|
51 |
openai.api_key = os.getenv('OPENAI_API_KEY')
|
librarymed/main.py
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import logging
|
3 |
-
from dotenv import load_dotenv
|
4 |
-
load_dotenv()
|
5 |
-
from .app_librarymed import app
|
6 |
-
|
7 |
-
app = app
|
8 |
-
|
9 |
-
if __name__ == '__main__':
|
10 |
-
port = os.getenv("PORT") or 8080
|
11 |
-
logging.info("Run LibraryMed interface v0.2.0 developed by Kromin")
|
12 |
-
app.run(debug=True, host="0.0.0.0", port=port)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|