updated model and examples
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
|
4 |
# API endpoint
|
5 |
-
API_URL = "https://api-inference.huggingface.co/models/Rahmat82/
|
6 |
import os
|
7 |
SECRET_KEY = os.environ.get("summarizer")
|
8 |
|
@@ -26,25 +26,14 @@ iface = gr.Interface(
|
|
26 |
submit_btn=gr.Button("Summarize", variant="primary"),
|
27 |
allow_flagging='never',
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
He said the letters were similar to what people write about today. They were about staying in touch, caring for people, and keeping passion alive.
|
38 |
-
"""],
|
39 |
-
["""
|
40 |
-
Carrots are good for our eyes. A new study from the National University of Singapore says grapes are also good.
|
41 |
-
It says eating a few grapes a day can help our vision. A researcher said: "Grape consumption beneficially impacts eye health in humans."
|
42 |
-
She said this was good as more people are getting older. She added that we can easily buy grapes. This research is good news for people who don't like carrots.
|
43 |
-
Thirty-four adults took part in the testing. Half of them ate grapes every day; the other half ate a placebo snack.
|
44 |
-
None of them knew if the tests were on the grapes or the snack. This gave better test results. The people who ate the grapes had better muscle strength around the retina.
|
45 |
-
The retina sends information about light to the brain. It protects the eyes from blue light, which damages the eye. A lot of blue light comes from computer screens.
|
46 |
-
"""]
|
47 |
-
]
|
48 |
)
|
49 |
|
50 |
iface.launch()
|
|
|
2 |
import requests
|
3 |
|
4 |
# API endpoint
|
5 |
+
API_URL = "https://api-inference.huggingface.co/models/Rahmat82/fastSUMMARIZER-t5-small-finetuned-on-xsum"
|
6 |
import os
|
7 |
SECRET_KEY = os.environ.get("summarizer")
|
8 |
|
|
|
26 |
submit_btn=gr.Button("Summarize", variant="primary"),
|
27 |
allow_flagging='never',
|
28 |
|
29 |
+
examples=[
|
30 |
+
["""
|
31 |
+
There will soon be flying taxis. Many of us grew up watching science fiction movies with these. The Japanese airline ANA and a U.S. tech start-up called Joby Aviation will fly air taxis at the 2025 World Expo in Osaka. They are currently building the taxis. They will need to follow air traffic rules. They will also need to train flying taxi pilots. The five-seat, all-electric taxi will take off and land vertically. It will fly as far as 241 kilometers and have a top speed of 321kph. Joby said the taxis are environmentally friendly. People can reduce their carbon footprint. It said Japan was a great place to test the taxis because 92 per cent of the population live in towns and cities. The president of ANA said the airline has 70 years of safe and reliable flights. He said it was good that customers have "the option to travel rapidly, and sustainably, from an international airport to a downtown location".
|
32 |
+
"""],
|
33 |
+
["""
|
34 |
+
Everybody knows that eating carrots is good for our eyesight. A new study suggests that grapes are also good for our eyes. Researchers from the National University of Singapore have found that eating just a few grapes a day can improve our vision. This is especially so for people who are older. Dr Eun Kim, the lead researcher, said: "Our study is the first to show that grape consumption beneficially impacts eye health in humans, which is very exciting, especially with a growing, ageing population." Dr Kim added that, "grapes are an easily accessible fruit that studies have shown can have a beneficial impact" on our eyesight. This is good news for people who don't really like carrots. The study is published in the journal "Food & Function". Thirty-four adults took part in a series of experiments over 16 weeks. Half of the participants ate one-and-a-half cups of grapes per day; the other half ate a placebo snack. Dr Kim did not tell the participants or the researchers whether she was testing the grapes or the snack. She thought that not revealing this information would give better test results. She found that people who ate the grapes had improved muscle strength around the retina. The retina passes information about light to the brain via electrical signals. It protects the eyes from damaging blue light. A lot of blue light comes from computer and smartphone screens, and from LED lights.
|
35 |
+
"""]
|
36 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
)
|
38 |
|
39 |
iface.launch()
|