Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions chapters/de/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ Bei der automatischen Textzusammenfassung (engl. Summarization) geht es darum, e
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -269,8 +268,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/en/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ Summarization is the task of reducing a text into a shorter text while keeping a
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -289,8 +288,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
14 changes: 13 additions & 1 deletion chapters/en/chapter2/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,19 @@ sequences = [
Once tokenized, we have:

```python
encoded_sequences = [
import torch

sequences = [
"I've been waiting for a HuggingFace course my whole life.",
"I hate this so much!",
]
encoded_sequences = tokenizer(sequences, padding=True).input_ids
print(encoded_sequences)
```


```python out
[
[
101,
1045,
Expand Down
6 changes: 2 additions & 4 deletions chapters/en/chapter9/7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ def flip_text(x):
demo = gr.Blocks()

with demo:
gr.Markdown(
"""
gr.Markdown("""
# Flip Text!
Start typing below to see the output.
"""
)
""")
input = gr.Textbox(placeholder="Flip this text")
output = gr.Textbox()

Expand Down
6 changes: 2 additions & 4 deletions chapters/es/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ Resumir es la tarea de reducir un texto en uno más corto, conservando todos (o
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -269,8 +268,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/fr/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ Le résumé est une tâche de réduction d'un texte en un texte plus court, tout
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -296,8 +295,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")

"""
L'Amérique a changé de façon spectaculaire au cours des dernières années. Non seulement le nombre de
Expand Down
6 changes: 2 additions & 4 deletions chapters/fr/chapter9/7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ def flip_text(x):
demo = gr.Blocks()

with demo:
gr.Markdown(
"""
gr.Markdown("""
# Flip Text!
Start typing below to see the output.
"""
)
""")
input = gr.Textbox(placeholder="Flip this text")
output = gr.Textbox()

Expand Down
6 changes: 2 additions & 4 deletions chapters/hi/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ question_answerer(
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -283,8 +282,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/it/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ Quello del riassunto è un compito che trasforma un testo in un testo più breve
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -269,8 +268,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/ja/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ question_answerer(
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -271,8 +270,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/ko/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ question_answerer(
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -269,8 +268,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/my/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ Summarization ဆိုတာက စာသားတစ်ခုကို ပိ
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -288,8 +287,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
4 changes: 3 additions & 1 deletion chapters/my/chapter10/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ settings = rg.Settings(
fields=[rg.TextField(name="text")],
questions=[
rg.LabelQuestion(
name="label", title="စာသားကို အမျိုးအစားခွဲပါ:", labels=data.unique("label_text")
name="label",
title="စာသားကို အမျိုးအစားခွဲပါ:",
labels=data.unique("label_text"),
),
rg.SpanQuestion(
name="entities",
Expand Down
4 changes: 3 additions & 1 deletion chapters/my/chapter9/5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ Hub ဒါမှမဟုတ် Spaces ကနေ demos တွေကို load

```py
gr.Interface.load(
"spaces/abidlabs/remove-bg", inputs="webcam", title="သင့် webcam နောက်ခံကို ဖယ်ရှားပါ!"
"spaces/abidlabs/remove-bg",
inputs="webcam",
title="သင့် webcam နောက်ခံကို ဖယ်ရှားပါ!",
).launch()
```

Expand Down
10 changes: 5 additions & 5 deletions chapters/my/chapter9/7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ def flip_text(x):
demo = gr.Blocks()

with demo:
gr.Markdown(
"""
gr.Markdown("""
# စာသားကို ပြောင်းပြန်လှန်ပါ။
အောက်မှာ စတင်ရိုက်ထည့်ပြီး output ကို ကြည့်ပါ။
"""
)
""")
input = gr.Textbox(placeholder="ဒီစာသားကို ပြောင်းပြန်လှန်ပါ")
output = gr.Textbox()

Expand Down Expand Up @@ -219,7 +217,9 @@ def change_textbox(choice):


with gr.Blocks() as block:
radio = gr.Radio(["short", "long", "none"], label="ဘယ်လို စာစီစာကုံးမျိုး ရေးချင်ပါသလဲ။")
radio = gr.Radio(
["short", "long", "none"], label="ဘယ်လို စာစီစာကုံးမျိုး ရေးချင်ပါသလဲ။"
)
text = gr.Textbox(lines=2, interactive=True)

radio.change(fn=change_textbox, inputs=radio, outputs=text)
Expand Down
6 changes: 2 additions & 4 deletions chapters/pt/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ Sumarização é uma tarefa de reduzir um texto em um texto menor enquanto pega
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -271,8 +270,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/ro/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ Rezumarea este sarcina de a reduce un text într-un altul mai scurt, păstrând
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -268,8 +267,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/ro/chapter9/7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ def flip_text(x):
demo = gr.Blocks()

with demo:
gr.Markdown(
"""
gr.Markdown("""
# Flip Text!
Start typing below to see the output.
"""
)
""")
input = gr.Textbox(placeholder="Flip this text")
output = gr.Textbox()

Expand Down
6 changes: 2 additions & 4 deletions chapters/ru/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ question_answerer(
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -276,8 +275,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
6 changes: 2 additions & 4 deletions chapters/ru/chapter9/7.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ def flip_text(x):
demo = gr.Blocks()

with demo:
gr.Markdown(
"""
gr.Markdown("""
# Flip Text!
Start typing below to see the output.
"""
)
""")
input = gr.Textbox(placeholder="Flip this text")
output = gr.Textbox()

Expand Down
6 changes: 2 additions & 4 deletions chapters/te/chapter1/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ question_answerer(
from transformers import pipeline

summarizer = pipeline("summarization")
summarizer(
"""
summarizer("""
America has changed dramatically during recent years. Not only has the number of
graduates in traditional engineering disciplines such as mechanical, civil,
electrical, chemical, and aeronautical engineering declined, but in most of
Expand All @@ -298,8 +297,7 @@ summarizer(
Other industrial countries at minimum maintain their output, while America
suffers an increasingly serious decline in the number of engineering graduates
and a lack of well-educated engineers.
"""
)
""")
```

```python out
Expand Down
Loading
Loading