Skip to content

Instantly share code, notes, and snippets.

@bhavika
Last active June 6, 2024 12:26
Show Gist options
  • Save bhavika/8827463b68a327dfe334a2a7fcc723de to your computer and use it in GitHub Desktop.
Save bhavika/8827463b68a327dfe334a2a7fcc723de to your computer and use it in GitHub Desktop.
import numpy as np
from transformers import AutoTokenizer, AutoModel
from pathlib import Path
from optimum.exporters import TasksManager
from optimum.exporters.onnx import export
import onnx
from optimum.exporters.onnx import validate_model_outputs
from optimum.onnxruntime import ORTModelForFeatureExtraction
import torch
long_input = """
In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games.
As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time.
As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres.
As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films.
The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience.
With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics.
The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms.
Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures.
Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community.
Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games.
Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries.
The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point.
In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games.
As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time.
As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres.
As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films.
The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience.
With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics.
The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms.
Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures.
Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community.
Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games.
Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries.
The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point.
In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games.
As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time.
As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres.
As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films.
The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience.
With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics.
The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms.
Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures.
Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community.
Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games.
Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries.
The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point.
In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games.
As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time.
As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres.
As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films.
The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience.
With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics.
The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms.
Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures.
Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community.
Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games.
Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries.
The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point.
In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games.
As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time.
As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi".
"""
if __name__ == "__main__":
MODEL_NAME = "nomic-ai/nomic-embed-text-v1.5"
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
long_inputs = tokenizer(long_input, return_tensors="pt", padding=True)
num_tokens = long_inputs['input_ids'].shape
print(f"Number of tokens in the input: {num_tokens}")
hf_model = AutoModel.from_pretrained(
MODEL_NAME,
trust_remote_code=True,
safe_serialization=True,
revision="91d2d6bfdddf0b0da840f901b533e99bae30d757",
force_download=True
)
onnx_path = Path("tests/nomic_bert.onnx")
onnx_config_constructor = TasksManager.get_exporter_config_constructor(
"onnx", hf_model, task="feature-extraction", library_name="transformers"
)
onnx_config = onnx_config_constructor(hf_model.config)
onnx_inputs, onnx_outputs = export(hf_model, onnx_config, onnx_path, onnx_config.DEFAULT_ONNX_OPSET)
print("After export")
print(onnx_inputs)
print(onnx_outputs)
onnx_model = onnx.load(onnx_path)
onnx.checker.check_model(onnx_model)
validate_model_outputs(onnx_config, hf_model, onnx_path, onnx_outputs, onnx_config.ATOL_FOR_VALIDATION)
model = ORTModelForFeatureExtraction.from_pretrained(
MODEL_NAME,
file_name="onnx/model.onnx",
trust_remote_code=True,
safe_serialization=True
)
long_inputs_gpu = {k: v.to('cuda') for k, v in long_inputs.items()}
hf_model.to('cuda')
model.to('cuda')
print("Testing for longer sequence length for Nomic-AI model")
optimum_model_outputs = model(**long_inputs_gpu)
hf_model_outputs = hf_model(**long_inputs_gpu)
print("Are outputs from both models close when using longer texts?", np.allclose(optimum_model_outputs.last_hidden_state.cpu().detach().numpy(), hf_model_outputs.last_hidden_state.cpu().detach().numpy(), rtol=1e-3, atol=1e-3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment