ABIcode23 commited on
Commit
a8b6bef
·
verified ·
1 Parent(s): ce9eb7c

Upload 5 files

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -2
  2. app.py +2 -2
Dockerfile CHANGED
@@ -25,9 +25,13 @@ COPY static/script.js static/
25
  # Make port 8000 available to the world outside this container
26
  EXPOSE 8000
27
 
28
- # Define environment variable
29
  ENV FLASK_APP=app.py
30
  ENV FLASK_RUN_HOST=0.0.0.0
 
 
 
 
31
 
32
  # Run app.py when the container launches
33
- CMD ["flask", "run", "--port=8000"]
 
25
  # Make port 8000 available to the world outside this container
26
  EXPOSE 8000
27
 
28
+ # Define environment variables
29
  ENV FLASK_APP=app.py
30
  ENV FLASK_RUN_HOST=0.0.0.0
31
+ ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
32
+
33
+ # Create the cache directory
34
+ RUN mkdir -p /app/.cache/huggingface/hub
35
 
36
  # Run app.py when the container launches
37
+ CMD ["flask", "run", "--port=8000"]
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
  import mysql.connector
5
  from groq import Groq
6
 
7
- app = Flask(name)
8
 
9
  # Initialize the text generation pipeline
10
  pipe = pipeline("text-generation", model="defog/sqlcoder-7b-2")
@@ -80,4 +80,4 @@ def chatbot():
80
  return jsonify({"error": str(e)}), 500
81
 
82
  if __name__ == '__main__':
83
- app.run(host='0.0.0.0', port=8000)
 
4
  import mysql.connector
5
  from groq import Groq
6
 
7
+ app = Flask(__name__)
8
 
9
  # Initialize the text generation pipeline
10
  pipe = pipeline("text-generation", model="defog/sqlcoder-7b-2")
 
80
  return jsonify({"error": str(e)}), 500
81
 
82
  if __name__ == '__main__':
83
+ app.run(host='0.0.0.0', port=8000)