syeedalireza commited on
Commit
bb274c0
·
verified ·
1 Parent(s): 7b84617

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. Dockerfile +14 -0
  2. README.md +2 -5
  3. app.py +1 -1
  4. requirements.txt +1 -3
Dockerfile ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
6
+ WORKDIR /home/user/app
7
+
8
+ COPY --chown=user requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ COPY --chown=user . .
12
+
13
+ EXPOSE 7860
14
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,11 +3,8 @@ title: Python Docstring Generator
3
  emoji: 📝
4
  colorFrom: blue
5
  colorTo: blue
6
- sdk: gradio
7
- sdk_version: 4.0.0
8
- app_file: app.py
9
- pinned: false
10
- python_version: "3.10"
11
  ---
12
 
13
  # Python Docstring Generator
 
3
  emoji: 📝
4
  colorFrom: blue
5
  colorTo: blue
6
+ sdk: docker
7
+ app_port: 7860
 
 
 
8
  ---
9
 
10
  # Python Docstring Generator
app.py CHANGED
@@ -25,4 +25,4 @@ demo = gr.Interface(
25
  description="Paste a Python function or snippet to get a short docstring summary.",
26
  )
27
  if __name__ == "__main__":
28
- demo.launch()
 
25
  description="Paste a Python function or snippet to get a short docstring summary.",
26
  )
27
  if __name__ == "__main__":
28
+ demo.launch(server_name="0.0.0.0", server_port=7860)
requirements.txt CHANGED
@@ -1,5 +1,3 @@
 
1
  torch>=2.0.0
2
  transformers>=4.30.0
3
- gradio>=4.0.0,<5.0.0
4
- accelerate>=0.20.0
5
- audioop-lts
 
1
+ gradio==4.44.0
2
  torch>=2.0.0
3
  transformers>=4.30.0