Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,29 +1,18 @@
|
|
1 |
pip install transformers
|
2 |
-
from transformers import
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
Democratizing AI
|
19 |
-
Hugging Face's most significant impact has been the democratization of AI and NLP. Their commitment to open-source development has made powerful AI models accessible to individuals, startups, and established organizations. This approach contrasts with the traditional proprietary AI model market, which often limits access to those with substantial resources.
|
20 |
-
By providing open-source models and tools, Hugging Face has empowered a diverse array of users to innovate and create their own NLP applications. This shift has fostered inclusivity, allowing a broader range of voices to contribute to AI research and development.
|
21 |
-
Industry Adoption
|
22 |
-
The success and impact of Hugging Face are evident in its widespread adoption. Numerous companies and institutions, from startups to tech giants, leverage Hugging Face's technology for their AI applications. This includes industries as varied as healthcare, finance, and entertainment, showcasing the versatility of NLP and Hugging Face's contributions.
|
23 |
-
Future Directions
|
24 |
-
Hugging Face's journey is far from over. As of my last knowledge update in September 2021, the company was actively pursuing research into ethical AI, bias reduction in models, and more. Given their track record of innovation and commitment to the AI community, it is likely that they will continue to lead in ethical AI development and promote responsible use of NLP technologies.
|
25 |
-
Conclusion
|
26 |
-
Hugging Face's story is one of transformation, collaboration, and empowerment. Their open-source contributions have reshaped the NLP landscape and democratized access to AI. As they continue to push the boundaries of AI research, we can expect Hugging Face to remain at the forefront of innovation, contributing to a more inclusive and ethical AI future. Their journey reminds us that the power of open-source collaboration can lead to groundbreaking advancements in technology and bring AI within the reach of many.
|
27 |
-
"""
|
28 |
-
print(summarizer(ARTICLE, max_length=1000, min_length=30, do_sample=False))
|
29 |
-
[{'summary_text': 'Hugging Face has emerged as a prominent and innovative force in NLP . From its inception to its role in democratizing AI, the company has left an indelible mark on the industry . The name "Hugging Face" was chosen to reflect the company\'s mission of making AI models more accessible and friendly to humans .'}]
|
|
|
1 |
pip install transformers
|
2 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
|
4 |
+
tokenizer = AutoTokenizer.from_pretrained("suriya7/bart-finetuned-text-summarization")
|
5 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("suriya7/bart-finetuned-text-summarization")
|
6 |
|
7 |
+
def generate_summary(text):
|
8 |
+
inputs = tokenizer([text], max_length=1024, return_tensors='pt', truncation=True)
|
9 |
+
summary_ids = model.generate(inputs['input_ids'], max_new_tokens=100, do_sample=False)
|
10 |
+
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
11 |
+
return summary
|
12 |
+
|
13 |
+
text_to_summarize = """Now, there is no doubt that one of the most important aspects of any Pixel phone is its camera.
|
14 |
+
And there might be good news for all camera lovers. Rumours have suggested that the Pixel 9 could come with a telephoto lens,
|
15 |
+
improving its photography capabilities even further. Google will likely continue to focus on using AI to enhance its camera performance,
|
16 |
+
in order to make sure that Pixel phones remain top contenders in the world of mobile photography."""
|
17 |
+
summary = generate_summary(text_to_summarize)
|
18 |
+
print(summary)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|