AdamNovotnyCom commited on
Commit
b124d69
·
0 Parent(s):

inint gradio

Browse files
Files changed (6) hide show
  1. .gitignore +176 -0
  2. Dockerfile +15 -0
  3. README.md +13 -0
  4. app.py +8 -0
  5. docker-compose.yml +16 -0
  6. requirements.txt +5 -0
.gitignore ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.DS_Store
2
+ *.vscode
3
+ *.pytest_cache
4
+ *.log"
5
+ flagged/*
6
+
7
+ # Terraform
8
+
9
+ # Local .terraform directories
10
+ **/.terraform/*
11
+
12
+ # .tfstate files
13
+ *.tfstate
14
+ *.tfstate.*
15
+
16
+ # Crash log files
17
+ crash.log
18
+
19
+ # Exclude all .tfvars files, which are likely to contain sentitive data, such as
20
+ # password, private keys, and other secrets. These should not be part of version
21
+ # control as they are data points which are potentially sensitive and subject
22
+ # to change depending on the environment.
23
+ #
24
+ *.tfvars
25
+
26
+ # Ignore override files as they are usually used to override resources locally and so
27
+ # are not checked in
28
+ override.tf
29
+ override.tf.json
30
+ *_override.tf
31
+ *_override.tf.json
32
+
33
+ # Include override files you do wish to add to version control using negated pattern
34
+ #
35
+ # !example_override.tf
36
+
37
+ # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
38
+ # example: *tfplan*
39
+
40
+ # Ignore CLI configuration files
41
+ .terraformrc
42
+ terraform.rc
43
+
44
+ # Byte-compiled / optimized / DLL files
45
+ __pycache__/
46
+ *.py[cod]
47
+ *$py.class
48
+
49
+ # C extensions
50
+ *.so
51
+
52
+ # Distribution / packaging
53
+ .Python
54
+ build/
55
+ develop-eggs/
56
+ dist/
57
+ downloads/
58
+ eggs/
59
+ .eggs/
60
+ lib/
61
+ lib64/
62
+ parts/
63
+ sdist/
64
+ var/
65
+ wheels/
66
+ pip-wheel-metadata/
67
+ share/python-wheels/
68
+ *.egg-info/
69
+ .installed.cfg
70
+ *.egg
71
+ MANIFEST
72
+
73
+ # PyInstaller
74
+ # Usually these files are written by a python script from a template
75
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
76
+ *.manifest
77
+ *.spec
78
+
79
+ # Installer logs
80
+ pip-log.txt
81
+ pip-delete-this-directory.txt
82
+
83
+ # Unit test / coverage reports
84
+ htmlcov/
85
+ .tox/
86
+ .nox/
87
+ .coverage
88
+ .coverage.*
89
+ .cache
90
+ nosetests.xml
91
+ coverage.xml
92
+ *.cover
93
+ *.py,cover
94
+ .hypothesis/
95
+ .pytest_cache/
96
+
97
+ # Translations
98
+ *.mo
99
+ *.pot
100
+
101
+ # Django stuff:
102
+ *.log
103
+ local_settings.py
104
+ db.sqlite3
105
+ db.sqlite3-journal
106
+
107
+ # Flask stuff:
108
+ instance/
109
+ .webassets-cache
110
+
111
+ # Scrapy stuff:
112
+ .scrapy
113
+
114
+ # Sphinx documentation
115
+ docs/_build/
116
+
117
+ # PyBuilder
118
+ target/
119
+
120
+ # Jupyter Notebook
121
+ .ipynb_checkpoints
122
+
123
+ # IPython
124
+ profile_default/
125
+ ipython_config.py
126
+
127
+ # pyenv
128
+ .python-version
129
+
130
+ # pipenv
131
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
132
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
133
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
134
+ # install all needed dependencies.
135
+ #Pipfile.lock
136
+
137
+ # celery beat schedule file
138
+ celerybeat-schedule
139
+
140
+ # SageMath parsed files
141
+ *.sage.py
142
+
143
+ # Environments
144
+ .env
145
+ .venv
146
+ env/
147
+ venv/
148
+ ENV/
149
+ env.bak/
150
+ venv.bak/
151
+
152
+ # Spyder project settings
153
+ .spyderproject
154
+ .spyproject
155
+
156
+ # Rope project settings
157
+ .ropeproject
158
+
159
+ # mkdocs documentation
160
+ /site
161
+
162
+ # mypy
163
+ .mypy_cache/
164
+ .dmypy.json
165
+ dmypy.json
166
+
167
+ # Pyre type checker
168
+ .pyre/
169
+ © 2019 GitHub, Inc.
170
+ Terms
171
+ Privacy
172
+ Security
173
+ Status
174
+ Help
175
+ Contact GitHub
176
+ Pricing
Dockerfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ RUN mkdir -p /mnt/app
4
+ ADD . /mnt/app
5
+ WORKDIR /mnt/app
6
+
7
+ RUN pip install -r requirements.txt
8
+
9
+ # Set up a new user named "user" with user ID 1000
10
+ RUN useradd -m -u 1000 user
11
+ USER user
12
+
13
+ EXPOSE 7860
14
+
15
+ CMD ["python", "app.py"]
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ title: Llama2 Gradio Hugging Face
2
+ sdk: docker
3
+ app_port:
4
+
5
+ ## Local Container management
6
+
7
+ Start
8
+
9
+ docker-compose -f docker-compose.yml up --detach llama2hf
10
+
11
+ View app in browser
12
+
13
+ http://127.0.0.1:7860
app.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!"
5
+
6
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+
8
+ demo.launch(server_name="0.0.0.0", server_port=7860)
docker-compose.yml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3'
2
+ services:
3
+ llama2hf:
4
+ container_name: llama2hf
5
+ image: llama2hf-image
6
+ build:
7
+ context: .
8
+ dockerfile: Dockerfile
9
+ volumes:
10
+ - ./:/mnt/app
11
+ working_dir: /mnt/app
12
+ stdin_open: true
13
+ tty: true
14
+ restart: always
15
+ ports:
16
+ - "7860:7860"
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ gradio==3.47.*
2
+ pandas==2.1.*
3
+ pytest==7.4.*
4
+ requests==2.31.*
5
+ scikit-learn==1.3.*