xynull commited on
Commit
d4aaa06
·
1 Parent(s): 5693968

Add application file

Browse files
Files changed (3) hide show
  1. Dockerfile +11 -0
  2. gpt2.py +4 -0
  3. requirements.txt +4 -0
Dockerfile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
+ COPY . .
10
+
11
+ CMD []
gpt2.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from transformers import pipeline, set_seed
2
+ generator = pipeline('text-generation', model='gpt2')
3
+ set_seed(42)
4
+ generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ torch
2
+ transformers
3
+ einops
4
+ tensorflow