Added Hugging Face Spaces link
Browse files
README.md
CHANGED
@@ -22,6 +22,8 @@ widget:
|
|
22 |
> This is part of the
|
23 |
[Flax/Jax Community Week](https://discuss.huggingface.co/t/recipe-generation-model/7475), organized by [HuggingFace](https://huggingface.co/) and TPU usage sponsored by Google.
|
24 |
|
|
|
|
|
25 |
|
26 |
## Team Members
|
27 |
- Mehrdad Farahani ([m3hrdadfi](https://huggingface.co/m3hrdadfi))
|
@@ -102,7 +104,8 @@ generation_kwargs = {
|
|
102 |
special_tokens = tokenizer.all_special_tokens
|
103 |
tokens_map = {
|
104 |
"<sep>": "--",
|
105 |
-
"<section>": "\
|
|
|
106 |
}
|
107 |
def skip_special_tokens(text, special_tokens):
|
108 |
for token in special_tokens:
|
@@ -159,7 +162,8 @@ items = [
|
|
159 |
]
|
160 |
generated = generation_function(items)
|
161 |
for text in generated:
|
162 |
-
sections = text.split("\
|
|
|
163 |
for section in sections:
|
164 |
section = section.strip()
|
165 |
if section.startswith("title:"):
|
@@ -177,7 +181,8 @@ for text in generated:
|
|
177 |
else:
|
178 |
section_info = [f" - {i+1}: {info.strip().capitalize()}" for i, info in enumerate(section.split("--"))]
|
179 |
print(f"[{headline}]:")
|
180 |
-
print("\
|
|
|
181 |
|
182 |
print("-" * 130)
|
183 |
```
|
|
|
22 |
> This is part of the
|
23 |
[Flax/Jax Community Week](https://discuss.huggingface.co/t/recipe-generation-model/7475), organized by [HuggingFace](https://huggingface.co/) and TPU usage sponsored by Google.
|
24 |
|
25 |
+
Want to give it a try? Then what's the wait, head over to Hugging Face Spaces [here](https://huggingface.co/spaces/flax-community/chef-transformer).
|
26 |
+
|
27 |
|
28 |
## Team Members
|
29 |
- Mehrdad Farahani ([m3hrdadfi](https://huggingface.co/m3hrdadfi))
|
|
|
104 |
special_tokens = tokenizer.all_special_tokens
|
105 |
tokens_map = {
|
106 |
"<sep>": "--",
|
107 |
+
"<section>": "\
|
108 |
+
"
|
109 |
}
|
110 |
def skip_special_tokens(text, special_tokens):
|
111 |
for token in special_tokens:
|
|
|
162 |
]
|
163 |
generated = generation_function(items)
|
164 |
for text in generated:
|
165 |
+
sections = text.split("\
|
166 |
+
")
|
167 |
for section in sections:
|
168 |
section = section.strip()
|
169 |
if section.startswith("title:"):
|
|
|
181 |
else:
|
182 |
section_info = [f" - {i+1}: {info.strip().capitalize()}" for i, info in enumerate(section.split("--"))]
|
183 |
print(f"[{headline}]:")
|
184 |
+
print("\
|
185 |
+
".join(section_info))
|
186 |
|
187 |
print("-" * 130)
|
188 |
```
|