Spaces:
Sleeping
Sleeping
Rename Keywords-to-Title-Generator.py to app.py
Browse files
Keywords-to-Title-Generator.py → app.py
RENAMED
@@ -5,8 +5,6 @@
|
|
5 |
# - https://huggingface.co/EnglishVoice/t5-base-keywords-to-headline?text=diabetic+diet+plan
|
6 |
# - Apache 2.0
|
7 |
|
8 |
-
# In[1]:
|
9 |
-
|
10 |
|
11 |
import torch
|
12 |
from transformers import T5ForConditionalGeneration,T5Tokenizer
|
@@ -17,11 +15,6 @@ model = T5ForConditionalGeneration.from_pretrained("EnglishVoice/t5-base-keyword
|
|
17 |
tokenizer = T5Tokenizer.from_pretrained("EnglishVoice/t5-base-keywords-to-headline", clean_up_tokenization_spaces=True, legacy=False)
|
18 |
model = model.to(device)
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
# In[55]:
|
23 |
-
|
24 |
-
|
25 |
keywords = "music, sleep, night"
|
26 |
|
27 |
text = "headline: " + keywords
|
@@ -50,39 +43,6 @@ for i in range(len(beam_outputs)):
|
|
50 |
print(result)
|
51 |
|
52 |
|
53 |
-
# In[1]:
|
54 |
-
|
55 |
-
|
56 |
-
import gradio as gr
|
57 |
-
|
58 |
-
|
59 |
-
# In[ ]:
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
# In[ ]:
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
# In[ ]:
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
# In[ ]:
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
# In[ ]:
|
84 |
-
|
85 |
-
|
86 |
'''
|
87 |
#Create a four button panel for changing parameters with one click
|
88 |
|
@@ -130,21 +90,6 @@ demo.launch()
|
|
130 |
'''
|
131 |
|
132 |
|
133 |
-
# In[164]:
|
134 |
-
|
135 |
-
|
136 |
-
import gc
|
137 |
-
gc.collect()
|
138 |
-
|
139 |
-
|
140 |
-
# In[166]:
|
141 |
-
|
142 |
-
|
143 |
-
gr.close_all()
|
144 |
-
|
145 |
-
|
146 |
-
# In[ ]:
|
147 |
-
|
148 |
|
149 |
|
150 |
|
|
|
5 |
# - https://huggingface.co/EnglishVoice/t5-base-keywords-to-headline?text=diabetic+diet+plan
|
6 |
# - Apache 2.0
|
7 |
|
|
|
|
|
8 |
|
9 |
import torch
|
10 |
from transformers import T5ForConditionalGeneration,T5Tokenizer
|
|
|
15 |
tokenizer = T5Tokenizer.from_pretrained("EnglishVoice/t5-base-keywords-to-headline", clean_up_tokenization_spaces=True, legacy=False)
|
16 |
model = model.to(device)
|
17 |
|
|
|
|
|
|
|
|
|
|
|
18 |
keywords = "music, sleep, night"
|
19 |
|
20 |
text = "headline: " + keywords
|
|
|
43 |
print(result)
|
44 |
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
'''
|
47 |
#Create a four button panel for changing parameters with one click
|
48 |
|
|
|
90 |
'''
|
91 |
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
|
95 |
|