AI說書 - 從0開始 - 428 | Vertex AI PaLM 2 API

更新 發佈閱讀 10 分鐘

我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。


以下使用 Vertex AI PaLM 2 進行多選擇決策問題:

from vertexai.language_models import TextGenerationModel

vertexai.init(project = "aiex-57523", location = "us-central1")
parameters = {"temperature": 0.2,
"max_output_tokens": 256,
"top_p": 0.8,
"top_k": 40}
model = TextGenerationModel.from_pretrained("text-bison@001")
response = model.predict("""Multi-choice problem: What is the topic of this text? - entertainment - technology - politics - sports - business - health - fun - culture - science Text: Samba, is a name or prefix used for several rhythmic variants, such as samba urbano carioca (urban Carioca samba), samba de roda (sometimes also called rural samba), recognized as part of the Intangible Cultural Heritage of Humanity by UNESCO, amongst many other forms of Samba, mostly originated in the Rio de Janeiro and Bahia States. Samba is a broad term for many of the rhythms that compose the better known Brazilian music genres that originated in the Afro-Brazilian communities of Bahia in the late 19th century and early 20th century, having continued its development on the communities of Rio de Janeiro in the early 20th century. Having its roots in the Afro-Brazilian Candomblé, as well as other Afro-Brazilian and Indigenous folk traditions, such as the traditional Samba de Caboclo, it is considered one of the most important cultural phenomena in Brazil and one of the country\'s symbols. Present in the Portuguese language at least since the 19th century, the word \"samba\" was originally used to designate a \"popular dance\". Over time, its meaning has been extended to a \"batuque-like circle dance\", a dance style, and also to a \"music genre\". This process of establishing itself as a musical genre began in the 1910s and it had its inaugural landmark in the song \"Pelo Telefone\", launched in 1917. Despite being identified by its creators, the public, and the Brazilian music industry as \"samba\", this pioneering style was much more connected from the rhythmic and instrumental point of view to maxixe than to samba itself. Samba was modernly structured as a musical genre only in the late 1920s from the neighborhood of Estácio and soon extended to Oswaldo Cruz and other parts of Rio through its commuter rail. Today synonymous with the rhythm of samba, this new samba brought innovations in rhythm, melody and also in thematic aspects. Its rhythmic change based on a new percussive instrumental pattern resulted in a more \"batucado\" and syncopated style – as opposed to the inaugural \"samba-maxixe\" – notably characterized by a faster tempo, longer notes and a characterized cadence far beyond the simple ones palms used so far. Also the \"Estácio paradigm\" innovated in the formatting of samba as a song, with its musical organization in first and second parts in both melody and lyrics. In this way, the sambistas of Estácio created, structured and redefined the urban Carioca samba as a genre in a modern and finished way. In this process of establishment as an urban and modern musical expression, the Carioca samba had the decisive role of samba schools, responsible for defining and legitimizing definitively the aesthetic bases of rhythm, and radio broadcasting, which greatly contributed to the diffusion and popularization of the genre and its song singers. Thus, samba has achieved major projection throughout Brazil and has become one of the main symbols of Brazilian national identity. Once criminalized and rejected for its Afro-Brazilian origins, and definitely working-class music in its mythic origins, the genre has also received support from members of the upper classes and the country\'s cultural elite.""", **parameters)
wrapped_text = textwrap.fill(response.text, width = 40)
print(wrapped_text)
留言
avatar-img
留言分享你的想法!
avatar-img
Learn AI 不 BI
244會員
947內容數
這裡將提供: AI、Machine Learning、Deep Learning、Reinforcement Learning、Probabilistic Graphical Model的讀書筆記與演算法介紹,一起在未來AI的世界擁抱AI技術,不BI。
Learn AI 不 BI的其他內容
2025/06/01
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 以下使用 Vertex AI PaLM 2 進行情感分析,並說明決策依據: from vertexai.language_models import TextGene
Thumbnail
2025/06/01
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 以下使用 Vertex AI PaLM 2 進行情感分析,並說明決策依據: from vertexai.language_models import TextGene
Thumbnail
2025/05/31
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 以下使用 Vertex AI PaLM 2 進行情感分析: from vertexai.language_models import TextGenerationMo
Thumbnail
2025/05/31
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 以下使用 Vertex AI PaLM 2 進行情感分析: from vertexai.language_models import TextGenerationMo
Thumbnail
2025/05/30
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 以下使用 Vertex AI PaLM 2 進行文章總結: import vertexai from vertexai.language_models import
Thumbnail
2025/05/30
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 以下使用 Vertex AI PaLM 2 進行文章總結: import vertexai from vertexai.language_models import
Thumbnail
看更多
你可能也想看
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 先做個總回顧: Transformer 架構總覽:AI說書 - 從0開始 - 39 Attention 意圖說明:AI說書 - 從0開始 - 40 Transfo
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 先做個總回顧: Transformer 架構總覽:AI說書 - 從0開始 - 39 Attention 意圖說明:AI說書 - 從0開始 - 40 Transfo
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 目前我們已經完成: Single-Head Attention 數學說明:AI說書 - 從0開始 - 52 Multi-Head Attention 數學說明:AI
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 我們已經在AI說書 - 從0開始 - 32中,展示了OpenAI的API如何使用,儘管 API 可以滿足許多需求,但它們也有其限制,例如,多用途 API 可能在所有任務
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 我們已經在AI說書 - 從0開始 - 32中,展示了OpenAI的API如何使用,儘管 API 可以滿足許多需求,但它們也有其限制,例如,多用途 API 可能在所有任務
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 延續AI說書 - 從0開始 - 25示範了ChatGPT程式的能力,同時在AI說書 - 從0開始 - 26靠ChatGPT產生Decision Tree程式,現在我們來
Thumbnail
我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。 延續AI說書 - 從0開始 - 25示範了ChatGPT程式的能力,同時在AI說書 - 從0開始 - 26靠ChatGPT產生Decision Tree程式,現在我們來
追蹤感興趣的內容從 Google News 追蹤更多 vocus 的最新精選內容追蹤 Google News