Spaces:
Sleeping
Sleeping
diegopacheco
commited on
Commit
•
147cdc9
1
Parent(s):
5f47a38
v1 of the app
Browse files- app.py +1 -1
- requirements.txt +2 -2
app.py
CHANGED
@@ -17,7 +17,7 @@ def describe_photo(image):
|
|
17 |
def generate_story(description):
|
18 |
model = GPT2LMHeadModel.from_pretrained("gpt2")
|
19 |
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
|
20 |
-
inputs = tokenizer.encode(description + "
|
21 |
outputs = model.generate(input_ids=inputs,
|
22 |
max_length=200,
|
23 |
num_return_sequences=1,
|
|
|
17 |
def generate_story(description):
|
18 |
model = GPT2LMHeadModel.from_pretrained("gpt2")
|
19 |
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
|
20 |
+
inputs = tokenizer.encode(description + ".A funny and friendly story.", return_tensors='pt')
|
21 |
outputs = model.generate(input_ids=inputs,
|
22 |
max_length=200,
|
23 |
num_return_sequences=1,
|
requirements.txt
CHANGED
@@ -10,10 +10,10 @@ scikit-learn
|
|
10 |
nltk
|
11 |
gensim
|
12 |
tensorflow
|
13 |
-
keras
|
14 |
opencv-python
|
15 |
fastapi
|
16 |
uvicorn
|
17 |
gTTS
|
18 |
openai-clip
|
19 |
-
gradio
|
|
|
|
10 |
nltk
|
11 |
gensim
|
12 |
tensorflow
|
|
|
13 |
opencv-python
|
14 |
fastapi
|
15 |
uvicorn
|
16 |
gTTS
|
17 |
openai-clip
|
18 |
+
gradio
|
19 |
+
tf-keras
|