Test1hdhs718 commited on
Commit
acb810e
·
1 Parent(s): 61a91b2
Files changed (3) hide show
  1. Dockerfile +5 -11
  2. OldDockerfile +20 -0
  3. hg.ipynb +53 -0
Dockerfile CHANGED
@@ -4,17 +4,11 @@ FROM python:3.9-slim
4
  # Thiết lập thư mục làm việc
5
  WORKDIR /app
6
 
7
- # Sao chép file requirements.txt vào thư mục làm việc
8
- COPY requirements.txt .
9
 
10
- # Cài đặt các dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
-
13
- # Sao chép toàn bộ mã nguồn vào thư mục làm việc
14
- COPY . .
15
-
16
- # Mở cổng 7860, nơi FastAPI sẽ chạy
17
  EXPOSE 7860
18
 
19
- # Khởi chạy ứng dụng bằng uvicorn khi container được khởi động
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
4
  # Thiết lập thư mục làm việc
5
  WORKDIR /app
6
 
7
+ # Cài đặt Jupyter các dependencies
8
+ RUN pip install --no-cache-dir jupyter
9
 
10
+ # Mở cổng 8888, nơi Jupyter sẽ chạy
 
 
 
 
 
 
11
  EXPOSE 7860
12
 
13
+ # Chạy lệnh để khởi động Jupyter Server
14
+ CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=7860", "--allow-root"]
OldDockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sử dụng Python 3.9
2
+ FROM python:3.9-slim
3
+
4
+ # Thiết lập thư mục làm việc
5
+ WORKDIR /app
6
+
7
+ # Sao chép file requirements.txt vào thư mục làm việc
8
+ COPY requirements.txt .
9
+
10
+ # Cài đặt các dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Sao chép toàn bộ mã nguồn vào thư mục làm việc
14
+ COPY . .
15
+
16
+ # Mở cổng 7860, nơi FastAPI sẽ chạy
17
+ EXPOSE 7860
18
+
19
+ # Khởi chạy ứng dụng bằng uvicorn khi container được khởi động
20
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
hg.ipynb ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "name": "stderr",
10
+ "output_type": "stream",
11
+ "text": [
12
+ "d:\\working\\T20\\repos\\test-app\\venv\\lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
13
+ " from .autonotebook import tqdm as notebook_tqdm\n"
14
+ ]
15
+ }
16
+ ],
17
+ "source": [
18
+ "from huggingface_hub import HfApi\n",
19
+ "api = HfApi()"
20
+ ]
21
+ },
22
+ {
23
+ "cell_type": "code",
24
+ "execution_count": null,
25
+ "metadata": {},
26
+ "outputs": [],
27
+ "source": [
28
+ "api.de"
29
+ ]
30
+ }
31
+ ],
32
+ "metadata": {
33
+ "kernelspec": {
34
+ "display_name": "venv",
35
+ "language": "python",
36
+ "name": "python3"
37
+ },
38
+ "language_info": {
39
+ "codemirror_mode": {
40
+ "name": "ipython",
41
+ "version": 3
42
+ },
43
+ "file_extension": ".py",
44
+ "mimetype": "text/x-python",
45
+ "name": "python",
46
+ "nbconvert_exporter": "python",
47
+ "pygments_lexer": "ipython3",
48
+ "version": "3.10.11"
49
+ }
50
+ },
51
+ "nbformat": 4,
52
+ "nbformat_minor": 2
53
+ }