srbmihaicode commited on
Commit
738c854
·
1 Parent(s): 31c0a7e
Files changed (4) hide show
  1. Dockerfile +14 -0
  2. README.md +1 -3
  3. app.py +1 -1
  4. requirements.txt +2 -2
Dockerfile ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ FROM python:3.9
3
+
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ WORKDIR /app
9
+
10
+ COPY --chown=user ./requirements.txt requirements.txt
11
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
+
13
+ COPY --chown=user . /app
14
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
README.md CHANGED
@@ -3,11 +3,9 @@ title: Journal
3
  emoji: 💬
4
  colorFrom: yellow
5
  colorTo: purple
6
- sdk: gradio
7
  sdk_version: 5.0.1
8
  app_file: app.py
9
  pinned: false
10
  short_description: Journal App
11
  ---
12
-
13
- An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index).
 
3
  emoji: 💬
4
  colorFrom: yellow
5
  colorTo: purple
6
+ sdk: docker
7
  sdk_version: 5.0.1
8
  app_file: app.py
9
  pinned: false
10
  short_description: Journal App
11
  ---
 
 
app.py CHANGED
@@ -31,7 +31,7 @@ def generate_response(message, history, system_message, max_tokens, temperature,
31
 
32
  return response
33
 
34
- @app.route("/chat", methods=["POST"])
35
  def home():
36
  return "Hi!"
37
  # API endpoint to handle requests
 
31
 
32
  return response
33
 
34
+ @app.route("/", methods=["POST","GET"])
35
  def home():
36
  return "Hi!"
37
  # API endpoint to handle requests
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- huggingface_hub==0.25.2
2
- flask==3.1.0
 
1
+ flask
2
+ uvicorn[standard]