BellXP commited on
Commit
d25ae12
β€’
1 Parent(s): 88d21a4
README.md CHANGED
@@ -1,12 +1,15 @@
1
  ---
2
- title: LLaMA Adapter V2
3
  emoji: πŸš€
4
- colorFrom: gray
5
- colorTo: yellow
6
  sdk: gradio
7
- sdk_version: 3.29.0
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
1
  ---
2
+ title: LLaMA Adapter
3
  emoji: πŸš€
4
+ colorFrom: red
5
+ colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 3.23.0
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
+ ### LLaMA-Adapter
13
+ The official demo for **LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention**.
14
+ Please refer to our [arXiv paper](https://arxiv.org/abs/2303.16199) and [github](https://github.com/ZrrSkywalker/LLaMA-Adapter) for more details.
15
+
alpaca_7b.json ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"answer_id": "nYR5ZQpVbEZMbLbKyuSdwc", "model_id": "Alpaca-7B", "question_id": 1, "text": "Improving time management skills involves setting realistic goals, breaking tasks down into smaller chunks, prioritizing tasks, and being mindful of how you spend your time. Additionally, it's important to create a schedule and plan for unexpected tasks or events.", "metadata": {}}
2
+ {"answer_id": "ghCAMyM7TJieBEvfYayeyS", "model_id": "Alpaca-7B", "question_id": 2, "text": "The most effective ways to deal with stress include identifying the source of the stress, developing healthy coping mechanisms, maintaining a balanced diet, engaging in physical activity, getting enough sleep, and taking time to relax and do something enjoyable.", "metadata": {}}
3
+ {"answer_id": "8YYjsZ8s4Ztnvyc2bKUZPW", "model_id": "Alpaca-7B", "question_id": 3, "text": "The main differences between Python and JavaScript programming languages are syntax, structure, and functionality. Python is a high-level, interpreted, general-purpose programming language that features dynamic semantics, data typing, and syntax that is both easy to read and intuitive. JavaScript is a low-level, interpreted, scripting language that features static semantics, dynamic typing, and syntax that is more difficult to read. Python is primarily used for web development, while JavaScript is primarily used for client-side scripting", "metadata": {}}
4
+ {"answer_id": "KTh8vTSRDyHD5R5aLhEMvo", "model_id": "Alpaca-7B", "question_id": 4, "text": "To increase productivity while working from home, try setting up a regular schedule and sticking to it. Set up specific times for work, breaks, and leisure activities, and set goals and tasks for each day. It can also help to create a dedicated workspace, remove distractions, and set boundaries between work and home. Additionally, make sure to take breaks throughout the day and engage in activities that help you relax and recharge.", "metadata": {}}
5
+ {"answer_id": "d94Myco32eidqZq8ZCpADU", "model_id": "Alpaca-7B", "question_id": 5, "text": "Quantum computing is a relatively new field of technology that uses the principles of quantum mechanics to store and process information. Unlike traditional computing, which relies on binary digits or bits, quantum computing uses quantum bits, or qubits, to encode information. These qubits can work together in groups, allowing them to solve complex problems much faster than their classical counterparts. Quantum computing also offers increased security, as it is harder to break the encryption used by quantum computers.", "metadata": {}}
6
+ {"answer_id": "BqwjYxRKWXnZhNEWs9krwL", "model_id": "Alpaca-7B", "question_id": 6, "text": "Plant-based protein sources include legumes, nuts, grains, and seeds. These proteins are often higher in fiber and have a lower overall fat content than animal-based proteins. Plant-based proteins are also more sustainable for the environment and have a lower carbon footprint. Animal-based proteins include meat, fish, eggs, and dairy. These proteins are higher in protein density and are generally lower in fiber and fat. Animal", "metadata": {}}
7
+ {"answer_id": "h7E9fKroyBw9K8SpLQRiYS", "model_id": "Alpaca-7B", "question_id": 7, "text": "Developing critical thinking skills involves training yourself to ask the right questions, evaluate evidence, and come to logical conclusions. Some ways to do this include reading and analyzing different sources of information, engaging in debates and discussions, and solving problems. Additionally, you can practice mindfulness and self-reflection, as well as seek out feedback from others.", "metadata": {}}
8
+ {"answer_id": "VJLNBpTLNVWbC4EdPXWxdL", "model_id": "Alpaca-7B", "question_id": 8, "text": "The major challenges faced by the education sector today include inadequate funding, lack of access to quality education for all, increasing disparities in learning outcomes, and the digital divide. Inadequate funding leads to inadequate resources and infrastructure in schools, while lack of access to quality education is a major issue in disadvantaged communities. There is also a wide disparity in learning outcomes between students from privileged and disadvantaged backgrounds", "metadata": {}}
9
+ {"answer_id": "XKf4k7eQH4miyaCFjeSgZw", "model_id": "Alpaca-7B", "question_id": 9, "text": "The primary factors that influence consumer behavior are psychological, social, cultural, and situational factors. Psychological factors include an individual's personality, attitudes, beliefs, and values. Social factors involve an individual's reference groups, such as family, friends, and peers. Cultural factors refer to an individual's shared beliefs and norms of a particular society. Situational factors consist of environmental influences, such as the context in which a consumer finds themselves.", "metadata": {}}
10
+ {"answer_id": "DUk7PFC9pu8hHkQbmhH2rL", "model_id": "Alpaca-7B", "question_id": 10, "text": "The most effective strategies for conflict resolution in the workplace include active listening and communication, understanding the underlying issues, empathizing with all parties involved, brainstorming solutions, and creating an action plan.", "metadata": {}}
11
+ {"answer_id": "Xmwr4YhxnVFRvwH6UGrUxU", "model_id": "Alpaca-7B", "question_id": 11, "text": "Using a single-use plastic bottle has a number of negative impacts on the environment and human health. On the environmental side, single-use plastic bottles are made from non-biodegradable materials and are a major source of plastic pollution. They can take hundreds of years to break down and are often mistaken for food by marine animals and birds, leading to their death. On the human health side, the chemicals and toxins leached from single-", "metadata": {}}
12
+ {"answer_id": "33gTmPBXKUPuCPmjuAiuwK", "model_id": "Alpaca-7B", "question_id": 12, "text": "When designing an inclusive and accessible public transportation system, factors such as access to stops, availability of real-time information, ease of use of fare payment systems, access to assistance services, and safety should be taken into consideration. Access to stops should include level boarding, adequate lighting, and clear signage. Availability of real-time information should include route and schedule information, as well as disruption and delay notifications. Ease of use of fare payment", "metadata": {}}
13
+ {"answer_id": "88QzDuou9UovxP9jHPrMpx", "model_id": "Alpaca-7B", "question_id": 13, "text": "Fiscal policies refer to government spending and taxation policies, and monetary policies refer to the actions of a central bank. During an economic recession, governments can utilize both fiscal and monetary policies to help stimulate the economy. Fiscal policies can include tax cuts, spending on infrastructure projects, and benefits for businesses and workers to incentivize them to invest and spend. Monetary policies can include lowering interest rates", "metadata": {}}
14
+ {"answer_id": "RMeYtwbMxJCP5K2RTvtVBz", "model_id": "Alpaca-7B", "question_id": 14, "text": "Language and cultural barriers can have a significant impact on the way people communicate and form relationships in multicultural societies. Language barriers can make it difficult to understand each other, leading to miscommunications and confusion. Cultural barriers can make it difficult to establish trust and create connections, as different cultural norms and values can lead to misunderstandings. Additionally, cultural differences in communication styles can lead to misinterpretations and offense. Despite these challenges, when people make an", "metadata": {}}
15
+ {"answer_id": "MDPhxBkpWFmQ2sgnx7brwC", "model_id": "Alpaca-7B", "question_id": 15, "text": "Artificial intelligence can be used to improve the quality and efficiency of healthcare delivery in a variety of ways. For example, AI-powered systems can be used to analyze patient data and diagnose diseases more accurately and quickly than traditional methods. AI can also be used to automate administrative tasks such as scheduling and patient intake forms, allowing healthcare providers to spend more time with patients. Additionally, AI-powered chatbots can be used to", "metadata": {}}
16
+ {"answer_id": "LwtdeYq5dPNHwCeXQsEiM6", "model_id": "Alpaca-7B", "question_id": 16, "text": "Gene editing is a process that uses CRISPR-Cas9 technology to make specific changes to an organism's DNA. It involves the use of two molecules, a guide RNA and an Cas9 enzyme, which locate and bind to a specific DNA sequence. Once bound, the Cas9 enzyme cuts the DNA at the targeted sequence. The cut DNA is then repaired using a donor DNA molecule, resulting in the insertion", "metadata": {}}
17
+ {"answer_id": "KG5Uby3MWAFjBvt3S6H4Tf", "model_id": "Alpaca-7B", "question_id": 17, "text": "Vaccinations work by introducing a weakened or inactive form of a virus or bacteria into the body. This allows the body to recognize the virus or bacteria and be better equipped to fight it off if it is ever encountered again. This process is known as immunization. \n\nHerd immunity is a concept in public health that describes how a population can become immune to a certain disease. When a large percentage of the population has been imm", "metadata": {}}
18
+ {"answer_id": "Xse26BoHysR53yBngjkXiT", "model_id": "Alpaca-7B", "question_id": 18, "text": "Social media platforms have had a significant impact on the way people consume and share news. This is largely due to the platform's use of algorithms, which prioritize certain types of content and make it more likely to be seen and shared. This has led to the spread of more polarizing and sensational content, as well as the proliferation of fake news. These developments have had a major impact on the accuracy of information shared, as well as the overall trustworthiness", "metadata": {}}
19
+ {"answer_id": "jy8CtSgpGzKomXWRaFK3M9", "model_id": "Alpaca-7B", "question_id": 19, "text": "Cultural, social, and economic factors can have a significant influence on people's food choices. For example, cultural norms can influence what foods are accepted and rejected, and what foods are perceived as being of higher or lower status. Social factors such as availability, cost, and convenience can also influence food choices. Additionally, economic factors such as income and education can be major determinants of what foods are available and affordable. This knowledge can be used to promote", "metadata": {}}
20
+ {"answer_id": "5rnFwD8vX3iZHoUmshBwza", "model_id": "Alpaca-7B", "question_id": 20, "text": "Natural selection is the process by which organisms that are better adapted to their environment are more likely to survive and reproduce. This process leads to the evolution of species, as the better adapted organisms pass on their traits to their offspring. Over time, these traits can become more common in the population, resulting in changes in the species' characteristics.", "metadata": {}}
21
+ {"answer_id": "4YvzYtFiHaYcoNBrpNP4jU", "model_id": "Alpaca-7B", "question_id": 21, "text": "My name is Sir John, and I am a knight of the realm. I am here to serve my king and my country, and I am proud to be part of this great kingdom. I am a loyal and honorable man, and I strive to uphold the ideals of chivalry and justice. I am a brave and skilled warrior, and I am always ready to defend my king and my people. I am a wise and compassionate leader", "metadata": {}}
22
+ {"answer_id": "ADFToiHu4fruDw5w4EC4PE", "model_id": "Alpaca-7B", "question_id": 22, "text": "We've all heard the legends of hidden treasure around these parts, and I'm determined to find it! I know we can do it, if we work together and keep a sharp eye out for any clues. So let's sail onward and never give up until we find that treasure!", "metadata": {}}
23
+ {"answer_id": "AV5wCLhJmPZtEce6dvKAgJ", "model_id": "Alpaca-7B", "question_id": 23, "text": "O, wherefore art thou Romeo?\nSay, beloved, where may I find thee?\nThou art gone and I am a captive in my own home.\nMy heart is heavy, yet my spirit flows in joy.\nI have loved none but thee, and I will love none but thee.\nThou art my sun, my moon, and all my stars.\nMy bounty is as boundless as the sea,\nMy love as deep", "metadata": {}}
24
+ {"answer_id": "CRVATohFzETarMvqXV8Mcp", "model_id": "Alpaca-7B", "question_id": 24, "text": "I was born with special powers that gave me the ability to do extraordinary things. I used my powers to help others and fight injustice, making sure that everyone in my city was safe. My origin story is a bit different than most superheroes, but I'm proud of the work I do and the impact I've made.", "metadata": {}}
25
+ {"answer_id": "BYjyupRbYE324tk7riDbX2", "model_id": "Alpaca-7B", "question_id": 25, "text": "I would tell people about the advancements in artificial intelligence, robotics, genetic engineering, and 3D printing. I would also mention the development of faster-than-light travel, the colonization of other planets and moons, and the creation of clean, renewable energy sources.", "metadata": {}}
26
+ {"answer_id": "57L5xZSSvUKGRd7yxMVwka", "model_id": "Alpaca-7B", "question_id": 26, "text": "With the game tied and just seconds remaining, the winning play was a long pass from the quarterback to the wide receiver in the end zone. The receiver made a spectacular catch and fell into the end zone, sealing the victory for the team.", "metadata": {}}
27
+ {"answer_id": "cr2s7KK5Jg7JfNZjeKABMz", "model_id": "Alpaca-7B", "question_id": 27, "text": "My signature dish is a decadent and indulgent dish that combines the rich flavors of the Mediterranean with the sweetness of the South. It is a dish that is sure to tantalize the taste buds and leave a lasting impression.", "metadata": {}}
28
+ {"answer_id": "YufdbpqjRfVMXgugYZB7cE", "model_id": "Alpaca-7B", "question_id": 28, "text": "At the summit of Mount Everest, I felt a sense of accomplishment and joy. The view was breathtaking, with the entire Himalayan range laid out before me. I felt a deep connection to nature and a sense of peace.", "metadata": {}}
29
+ {"answer_id": "6DTpRsZ4KDQeRttS9i8ycR", "model_id": "Alpaca-7B", "question_id": 29, "text": "As a space colonist on Mars, my daily life is filled with both challenges and rewards. Every day is an adventure as I explore this strange and beautiful planet. I face many challenges, such as the hostile environment and the lack of resources, but I'm determined to make this colony a success. I must also contend with the psychological toll of being so far from home, as well as the loneliness of living in an isolated outpost.", "metadata": {}}
30
+ {"answer_id": "gL3Qf2ffrna4cV2H8q76MR", "model_id": "Alpaca-7B", "question_id": 30, "text": "I am a survivor in a post-apocalyptic world. I have to rely on my wits and the skills I've picked up along the way to stay alive. I scavenge for food and supplies, and I'm always on the lookout for new ways to survive. I have to be careful, though, because the world is dangerous and full of predators. I have to take risks in order to stay alive, but I'm always", "metadata": {}}
31
+ {"answer_id": "86xLSzMhopgPUQNdjdFvBJ", "model_id": "Alpaca-7B", "question_id": 31, "text": "You can determine if a restaurant is popular among locals or mainly attracts tourists by looking at the customer base. If the restaurant is mainly populated by locals, then it is likely popular among locals. If the restaurant is mainly populated by tourists, then it is likely mainly attracting tourists. This information is useful because it can help you find restaurants that fit your preferences. If you are looking for a more authentic experience, you would want to find restaurants that are", "metadata": {}}
32
+ {"answer_id": "LJq26PnGbWbvxAfvCi2PC5", "model_id": "Alpaca-7B", "question_id": 32, "text": "Some subtle clues that suggest someone is pretending to understand a topic or conversation when they are actually confused or uninformed include avoiding direct eye contact, speaking in a slower or louder voice, repeating questions or statements in a different form, and using jargon or technical terms. Other signs include nodding along with the conversation while not actually engaging in it, offering opinions on topics without being asked, and asking questions that are too basic or too advanced for the conversation.", "metadata": {}}
33
+ {"answer_id": "YRPMvQZ3s3apZeRWJ2xedT", "model_id": "Alpaca-7B", "question_id": 33, "text": "Someone might choose to use a paper map or ask for directions instead of relying on a GPS device or smartphone app because they prefer the traditional method, find it more reliable, or want to be more aware of their surroundings. Additionally, some GPS devices or smartphone apps may not be available in certain areas, or the user may prefer to avoid data charges.", "metadata": {}}
34
+ {"answer_id": "VYqxJH2izqaqK3kj9pyumG", "model_id": "Alpaca-7B", "question_id": 34, "text": "One way to determine if a person is genuinely interested in a conversation or simply being polite is to observe their body language. If someone is truly engaged in the conversation, they will make eye contact, nod, and give verbal cues that show they are listening. If someone is being polite, they may still make some of these gestures, but they will be less frequent and less intense than if they were truly engaged. Additionally, you can ask yourself if the person is", "metadata": {}}
35
+ {"answer_id": "kSTtVnUNy6SHCDgNb7wUrT", "model_id": "Alpaca-7B", "question_id": 35, "text": "People may prefer to shop at a small, locally-owned business because they want to support the local economy, they value the personalized service and attention, and they may feel that the quality of the products is better than at a large chain store. Additionally, they may feel that the prices are worth paying for the convenience and personalized service.", "metadata": {}}
36
+ {"answer_id": "c7c2sQVDmEJe3bUaEGvMph", "model_id": "Alpaca-7B", "question_id": 36, "text": "One way to assess the credibility of a source of information is to look at the evidence that supports the claims made in the article or blog post. Is the evidence reliable? Is it from a trustworthy source? Are there any counterarguments or alternative explanations? Additionally, it is important to look at the author\u2019s argument and make sure that it is logical and that all facts are properly cited. Finally, it is important to look at the purpose of the article or blog post.", "metadata": {}}
37
+ {"answer_id": "UJyzwK8yzdgtYCNbewVqZv", "model_id": "Alpaca-7B", "question_id": 37, "text": "Some people enjoy the feeling of being scared because it can bring about a sense of excitement and adrenaline rush. This feeling can be similar to the feeling of being in love or when someone is challenged in some way. For these people, the thrill of being scared can be an exhilarating experience. On the other hand, some people avoid these experiences because they are uncomfortable with feeling afraid or they simply don't enjoy the sensation.", "metadata": {}}
38
+ {"answer_id": "BDEdH6DbqwALamyhDojkcs", "model_id": "Alpaca-7B", "question_id": 38, "text": "By observing the behavior of other people in a social situation, one can gain insight into the cultural norms and expectations of that particular culture. For example, body language, facial expressions, and the way people interact with each other can provide clues as to how one should act in a particular situation. Additionally, observing the types of conversations people have and the topics they discuss can give insight into the values and beliefs that are considered important in that culture.", "metadata": {}}
39
+ {"answer_id": "LFQegPayDZKkoBHihjNq5J", "model_id": "Alpaca-7B", "question_id": 39, "text": "I believe that we have a moral obligation to explore space, as it could potentially help us to solve some of the world's most pressing problems. For example, space exploration could lead to the development of new technologies that could be used to improve the lives of people on Earth, such as new medical treatments, more efficient energy sources, and improved communication systems. Additionally, space exploration could inspire and motivate people to pursue careers in science, technology, engineering,", "metadata": {}}
40
+ {"answer_id": "PGsxzDMsKsRrbgeZ2Gynkn", "model_id": "Alpaca-7B", "question_id": 40, "text": "It is important to prioritize both job creation and technological progress in the world of automation. Automation can create jobs in the short-term by replacing manual labour and creating new roles for people to fill. In the long-term, technological progress is necessary to ensure that automation is used to benefit society and create a better future.", "metadata": {}}
41
+ {"answer_id": "hMhyh2qpM6Tzk6AuxDMViM", "model_id": "Alpaca-7B", "question_id": 41, "text": "The average human blinks 12 times per minute, which works out to 17,600 times per day and 6,400,000 times in a lifetime. This is because blinking is a reflex action that helps to keep the eyes lubricated and clean, and it also helps to protect the eyes from dust and debris.", "metadata": {}}
42
+ {"answer_id": "nAuebSvh2z7pRY8xyfFhne", "model_id": "Alpaca-7B", "question_id": 42, "text": "A grain of salt is made up of millions of atoms. A single grain of salt is composed of millions of tiny crystals, each of which is made up of thousands of atoms. The average grain of salt contains about 2,000 to 3,000 atoms.", "metadata": {}}
43
+ {"answer_id": "6DFP47LWbPBBqy9FysAWrX", "model_id": "Alpaca-7B", "question_id": 43, "text": "Approximately 100 lightning strikes occur on Earth each day. This is because lightning is a natural phenomenon that is caused by the discharge of atmospheric electricity. When positively charged particles accumulate in the atmosphere, they become attracted to negatively charged particles, causing an electric field to form. When these fields reach a strong enough level, the electricity discharges in the form of lightning. The positively charged particles move upward", "metadata": {}}
44
+ {"answer_id": "B3CQoBErFRAr7anauXrtrt", "model_id": "Alpaca-7B", "question_id": 44, "text": "It would take a huge number of balloons to lift a house. To explain why, we need to consider the weight of the house and the amount of lift provided by the balloons. The weight of the house is determined by its volume, which is determined by the size and number of its walls and other features. To lift the house, the balloons would need to generate enough lift to overcome the weight of the house. This means that the number of balloons needed would", "metadata": {}}
45
+ {"answer_id": "E6vPWKD9WBNhFZvQgVnDys", "model_id": "Alpaca-7B", "question_id": 45, "text": "According to a 2019 report by the Radicati Group, an estimated 21.8 billion text messages are sent globally in a minute. This is estimated to grow to 22.1 billion messages by the end of 2020. This means that on average, over 21.8 billion text messages are sent every minute. This is largely due to the increasing popularity of mobile messaging applications such as WhatsApp, Facebook M", "metadata": {}}
46
+ {"answer_id": "AQXQhAw4JmASjk8Li6jaP4", "model_id": "Alpaca-7B", "question_id": 46, "text": "According to research, approximately 17,000 words are spoken daily on Earth. This is estimated to be the average number of words spoken by adults in a typical day. This number is based on the average number of words spoken by adults in a variety of different languages. It is estimated that children speak even more words than adults, with some children speaking as many as 30,000 words a day.", "metadata": {}}
47
+ {"answer_id": "3pFMSmZnLQpzrxt4ZsgaKJ", "model_id": "Alpaca-7B", "question_id": 47, "text": "During a typical winter, it is estimated that around 100 million snowflakes fall. This is based on the fact that snowflakes are small and light, and can easily be detected by radar. It is estimated that around 100 million snowflakes can fall in a typical winter, with each snowflake weighing around 0.002 grams.", "metadata": {}}
48
+ {"answer_id": "bHectk8hdaSz4ngf4xCBMe", "model_id": "Alpaca-7B", "question_id": 48, "text": "It is difficult to give an exact answer to this question, as there are many factors that can affect the number of pages in a book. However, according to a survey conducted by the United Nations Educational, Scientific and Cultural Organization (UNESCO), there are approximately 131.5 million books in existence. If we assume that the average book has roughly the same number of pages, this would mean that the total number of pages in all the books ever written is approximately", "metadata": {}}
49
+ {"answer_id": "gHacXgkeccoNGnapcVQWse", "model_id": "Alpaca-7B", "question_id": 49, "text": "The Earth has orbited the Sun 400 times since the beginning of life. This is calculated by multiplying 4.5 billion years (the age of the Earth) by 2\u03c0, which is equal to 400. This means that the Earth has made 400 revolutions around the Sun since life began.", "metadata": {}}
50
+ {"answer_id": "UHUDBQy8a24MhmZpVpxB4H", "model_id": "Alpaca-7B", "question_id": 50, "text": "It is difficult to give an exact number of songs that have been recorded throughout history, as the definition of a song varies greatly and there are many different genres and styles of music. However, according to the Recording Industry Association of America, there are over 30 million songs that have been registered with them since 1978. This number does not include songs that have not been registered or those that have been recorded prior to 1978. Additionally, the", "metadata": {}}
51
+ {"answer_id": "TKDDCyWoTSEHeZfKJ3n7WM", "model_id": "Alpaca-7B", "question_id": 51, "text": "If the Internet had been invented during the Renaissance period, it would have revolutionized the way people communicated, exchanged ideas, and accessed information. Instead of relying on physical books and journals, people would have been able to access a vast amount of knowledge online, allowing them to collaborate and share ideas more easily than ever before.", "metadata": {}}
52
+ {"answer_id": "42H4nQKyeiaiY2bXvMYBGT", "model_id": "Alpaca-7B", "question_id": 52, "text": "If the Aztecs had successfully repelled the Spanish conquistadors, Mexico would have remained an independent nation and the Spanish language would have remained a minor language in the region. The culture and religion of the Aztecs would have continued to influence the region, and the history of the world would have been drastically changed.", "metadata": {}}
53
+ {"answer_id": "jixfR6ezeuiRxwoQR2Zegm", "model_id": "Alpaca-7B", "question_id": 53, "text": "The Black Death had a significant impact on the population of Europe in the 14th century, reducing it by an estimated 30-60%. If the Black Death had not occurred, the population of Europe would have likely continued to grow, leading to an increase in the demand for goods and services. This could have led to higher wages, improved working conditions, and an overall better quality of life for many Europeans. Additionally, the absence of the Black Death would have likely resulted", "metadata": {}}
54
+ {"answer_id": "LXy7MajmgBCwtX3PpcNrnm", "model_id": "Alpaca-7B", "question_id": 54, "text": "If Isaac Newton had focused on biology instead of physics, he might have made important contributions to our understanding of the biological world. For example, he may have developed new theories about the processes of evolution and natural selection. He could have studied the diversity of life on Earth and explored the complex relationships between organisms and their environment. He may have even made groundbreaking discoveries in the field of medicine. Ultimately, the world may have been changed in ways we can't", "metadata": {}}
55
+ {"answer_id": "7xZchhmfPaBVeM4RvBpc9B", "model_id": "Alpaca-7B", "question_id": 55, "text": "It is difficult to imagine the world without the Beatles, who have had an immense impact on music, culture, and popular culture. Without the Beatles, the music industry may have developed differently, and many of the artists who have followed in their footsteps may not have been inspired to pursue music as a career.", "metadata": {}}
56
+ {"answer_id": "6njM9nkF6CSXffbEvhQnZH", "model_id": "Alpaca-7B", "question_id": 56, "text": "Without Alan Turing's work, the Allies would not have been able to crack the Enigma code, and the war would have lasted much longer. The Nazis would have been able to continue their campaign of terror and conquest, and the outcome of the war may have been very different.", "metadata": {}}
57
+ {"answer_id": "6bqLMJxgPP6QBiYon5XUTk", "model_id": "Alpaca-7B", "question_id": 57, "text": "The Suez Canal was a major factor in the growth of global trade and commerce in the 19th and 20th centuries, connecting the Mediterranean and Red Seas. Its construction in 1869 reduced the journey time for ships travelling between Europe and Asia by more than 4,000 miles. Without the Suez Canal, ships would have to travel around the southern tip of Africa, adding several thousand miles to their journey. This would have a", "metadata": {}}
58
+ {"answer_id": "5iPuKm4fX5xVb7eTAvUFNN", "model_id": "Alpaca-7B", "question_id": 58, "text": "The Maya civilization may have continued in its current form, or it may have evolved in unexpected ways. Without the collapse, the Maya would have had more time to develop their culture and society, potentially leading to new technological advances and social structures. Additionally, the Maya's spiritual and religious beliefs may have changed over time, leading to new practices and understandings of their world.", "metadata": {}}
59
+ {"answer_id": "eYrUJirqdorWRpxS9iyAm3", "model_id": "Alpaca-7B", "question_id": 59, "text": "If Christopher Columbus had not discovered the Americas, the world would be very different today. The Europeans would not have had access to the resources of the New World, and the global economy would be much different. Additionally, the indigenous people of the Americas would have likely remained undisturbed, preserving their traditional cultures and societies.", "metadata": {}}
60
+ {"answer_id": "TDvwfrG9CgBmHS6cqe2AcZ", "model_id": "Alpaca-7B", "question_id": 60, "text": "If Vincent van Gogh had been a successful artist during his lifetime, he would have likely continued to create and produce artwork, perhaps even on a larger scale than he did during his lifetime. He would have been able to afford better materials and more expensive mediums, allowing him to create more complex and detailed pieces. He may have even been able to travel more, exposing him to different cultures and environments which could have further inspired his work. Additionally, if he had been successful during", "metadata": {}}
61
+ {"answer_id": "BCVhKE7uh9CsEjczXC8UiC", "model_id": "Alpaca-7B", "question_id": 61, "text": "#include <iostream>\n#include <fstream>\n#include <string>\n#include <map>\n\nusing namespace std;\n\nint main() {\n // Declare variables\n string line;\n int count = 0;\n\n // Open text file\n ifstream myfile(\"file.txt\");\n\n // Read the file line by line\n while (getline(myfile, line)) {\n // Split", "metadata": {}}
62
+ {"answer_id": "Cgop3KT4LpvM7RAGrEpUnB", "model_id": "Alpaca-7B", "question_id": 62, "text": "def longest_common_subsequence(s1, s2):\n # Initializing the length of the result with 0\n n1 = 0\n n2 = 0\n # Using a dynamic programming approach\n for i in range(len(s1)):\n n1 = max(n1, len(s1[i]))\n for i in range(len(s2)):\n n2 = max(n2,", "metadata": {}}
63
+ {"answer_id": "b4qwaRtzK8q7CLzyG3jU7u", "model_id": "Alpaca-7B", "question_id": 63, "text": "import re\n\ndef validate_email(email):\n pattern = '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,3}$'\n return re.match(pattern, email) is not None", "metadata": {}}
64
+ {"answer_id": "jRwu9Jsf8Qjxg644YuWFAv", "model_id": "Alpaca-7B", "question_id": 64, "text": "def Fibonacci(n): \n if n == 0: \n return 0\n elif n == 1: \n return 1\n else: \n return Fibonacci(n-1) + Fibonacci(n-2) \n\ndef FibonacciDynamic(n): \n a = 0\n b = 1\n if n < 0: \n ", "metadata": {}}
65
+ {"answer_id": "LvpYTUz7J24Ua5qmuwc9kY", "model_id": "Alpaca-7B", "question_id": 65, "text": "def binary_search(arr, l, r, x):\n # Base case\n if r >= l:\n # We use this flag to remember if the element is present\n present = False\n # Go through the array until the element is found or\n # we reach the end of the array\n for i in range(l, r + 1):\n if arr[i] == x:\n present = True\n break\n", "metadata": {}}
66
+ {"answer_id": "nhnEtACvtqG55H2j4BcH48", "model_id": "Alpaca-7B", "question_id": 66, "text": "class Queue:\n def __init__(self):\n self.items = []\n self.front = None\n self.back = None\n \n def enqueue(self, item):\n if self.front is None:\n self.front = None\n elif self.back is None:\n self.back = None\n else:\n self.items.append(item)\n \n def dequeue(self", "metadata": {}}
67
+ {"answer_id": "AhUvWkN85nB6n3uTV8ENUo", "model_id": "Alpaca-7B", "question_id": 67, "text": "def find_common_elements(arr1, arr2):\n # Create an empty list to store the common elements\n common_elems = []\n\n # Iterate over the elements of arr1\n for i in arr1:\n # Check if the element is present in arr2\n if i in arr2:\n # Add the element to the common list\n common_elems.append(i)\n # Return the common", "metadata": {}}
68
+ {"answer_id": "n5LwnN8jibaUz8uZ8DYeMU", "model_id": "Alpaca-7B", "question_id": 68, "text": "The value of f(2) is 11.", "metadata": {}}
69
+ {"answer_id": "MEY7UkyMhfjmLKaEWAN3dd", "model_id": "Alpaca-7B", "question_id": 69, "text": "x = 8", "metadata": {}}
70
+ {"answer_id": "LbjXo5u8HkUtboUoQhpKCe", "model_id": "Alpaca-7B", "question_id": 70, "text": "The length of the line segment is 8 units.", "metadata": {}}
71
+ {"answer_id": "Ejon3ja2NTxMQzKWJaAeyj", "model_id": "Alpaca-7B", "question_id": 71, "text": "Dear [Name],\n\nI am writing to express my interest in exploring a potential joint venture with your company. I believe that our combined expertise and resources could create a powerful and successful partnership. \n\nI look forward to discussing the details with you and exploring the possibilities that a joint venture could bring. Please do not hesitate to contact me if you are interested in discussing this further.\n\nSincerely, \n[Your Name", "metadata": {}}
72
+ {"answer_id": "atwJcVT2dmxR8rBj8fxtpz", "model_id": "Alpaca-7B", "question_id": 72, "text": "Dear [Employer],\n\nI am writing to inform you of my intention to resign from my position as [job title] at [company name]. I have appreciated my time here and the opportunities that I have been given over the past [time period]. I have learned a lot and am grateful for the experience.\n\nI wish the company all the best in the future and I am confident that the hard work and dedication of the team will ensure success.\n\n", "metadata": {}}
73
+ {"answer_id": "mVrZCyxiCzKkhGmSZfdw9E", "model_id": "Alpaca-7B", "question_id": 73, "text": "I am writing to recommend [Name], who is applying to the prestigious graduate program in computer science. [Name] has a strong background in computer science and has demonstrated exceptional talent in the field. \n\n[Name] has taken several courses in computer science, including [list of courses]. He has consistently earned high marks and has been an active participant in class discussions. He is also an avid learner, having taught himself several programming languages.\n\n", "metadata": {}}
74
+ {"answer_id": "CofijcezX7E6DCtZtTo4oH", "model_id": "Alpaca-7B", "question_id": 74, "text": "Dear valued customers,\n\nWe are excited to announce the launch of our new software solution \u2013 a revolutionary product that is designed to revolutionize the way businesses operate. Our software is the result of extensive research and development, and we are confident that it will help businesses of all sizes increase productivity and efficiency.\n\nOur software is easy to use, reliable and secure. It is also scalable and customizable, so it can be adapted to the individual needs", "metadata": {}}
75
+ {"answer_id": "JDb7YLQWyxBzHwUFAEPr3h", "model_id": "Alpaca-7B", "question_id": 75, "text": "Dear Customer,\n\nWe apologize for the delay you experienced with your order. We understand how important it is for you to receive your order on time, and we want to assure you that we are doing everything possible to ensure that your order is processed as quickly as possible. \n\nWe have reviewed our processes and identified the cause of the delay. We have also taken steps to ensure that this does not happen again. \n\nAgain, we apologize for the", "metadata": {}}
76
+ {"answer_id": "Q68An6ZaM5H7KQ5TY8q5b8", "model_id": "Alpaca-7B", "question_id": 76, "text": "Welcome to a journey through the history and cultural significance of jazz. Jazz is one of the most influential and beloved genres of music, and its impact reaches far beyond the world of music. From its origins in the late 19th century to its continuing relevance today, jazz has been a source of creative expression, social commentary, and sheer musical joy. \n\nThe roots of jazz lie in the confluence of African and European musical trad", "metadata": {}}
77
+ {"answer_id": "FX7zpKsRkF2EBGWDub8D6x", "model_id": "Alpaca-7B", "question_id": 77, "text": "I recently had the chance to travel to Hawaii and it was even more amazing than I expected. From the beautiful beaches to the lush rainforests, the island of Hawaii has so much to offer. One of my favorite experiences was visiting the local cultural sites. From the historic Pearl Harbor Museum to the traditional Hawaiian temples, each experience gave me a deeper understanding of the unique culture of the island. I also had the chance to take a helicopter", "metadata": {}}
78
+ {"answer_id": "H9t3BnVt29sPXr4QqDuKfD", "model_id": "Alpaca-7B", "question_id": 78, "text": "Recently released science fiction film is an exciting, action-packed thrill ride from start to finish. The plot is complex and engaging, with interesting twists and turns that keep you on the edge of your seat. The characters are well developed and relatable, and the special effects are stunning and immersive. This movie is a must-watch for any fan of the science fiction genre.", "metadata": {}}
79
+ {"answer_id": "bfWW9jggjLE9YWV639kpcc", "model_id": "Alpaca-7B", "question_id": 79, "text": "Welcome to the Music Matters podcast. This week, we\u2019re talking about the impact of streaming platforms on the music industry. We\u2019ll discuss how streaming services have changed the way we consume and create music, the pros and cons of this shift, and how artists are adapting to the new landscape. \n\nWe\u2019ll be joined by guests who can share their insights and experiences, including artists, industry experts, and fans. Our first guest is a chart-", "metadata": {}}
80
+ {"answer_id": "34RnqHAxMpCERFawz6svZP", "model_id": "Alpaca-7B", "question_id": 80, "text": "The symphony concert was a great success. The orchestra performed with great precision and skill, playing a variety of pieces that kept the audience engaged. The concert hall was beautiful and the acoustics were perfect, allowing for a truly immersive experience. The audience was enthralled, applauding and cheering at the end of each piece. All in all, it was a wonderful evening of music and everyone left feeling inspired.", "metadata": {}}
alpaca_lora_7b.json ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"answer_id": "EJP3DLp69qT6zr5tzvrzhV", "model_id": "Alpaca-LoRA-7B", "question_id": 1, "text": "One way to improve your time management skills is to create a to-do list and prioritize tasks according to their importance and urgency. Break down large tasks into smaller, more manageable chunks, and set realistic deadlines for each task. Make sure to take regular breaks throughout the day to stay focused and energized.", "metadata": {}}
2
+ {"answer_id": "9d9a8mtqKTyu4YAUKKxRVE", "model_id": "Alpaca-LoRA-7B", "question_id": 2, "text": "The most effective ways to deal with stress include exercising regularly, getting enough sleep, eating a healthy diet, practicing mindfulness and relaxation techniques, and spending time with friends and family.", "metadata": {}}
3
+ {"answer_id": "K44UzhSrVEtkxSQNg4jJQE", "model_id": "Alpaca-LoRA-7B", "question_id": 3, "text": "The main differences between Python and JavaScript programming languages are: \n1. Python is a general-purpose programming language, while JavaScript is a scripting language. \n2. Python is an interpreted language, while JavaScript is a compiled language. \n3. Python is an object-oriented language, while JavaScript is a prototype-based language. \n4. Python is a statically typed language, while JavaScript is a dynamically typed language. \n5. Python is a multi-paradigm language, while JavaScript is a single-paradigm language.", "metadata": {}}
4
+ {"answer_id": "F3k4J4nZTapV9KrteZBCRb", "model_id": "Alpaca-LoRA-7B", "question_id": 4, "text": "There are several ways to increase productivity while working from home. Firstly, it is important to create a workspace that is comfortable and conducive to productivity. This could include setting up a desk in a quiet area of the house, arranging for natural lighting, and setting up a comfortable chair. Secondly, it is important to create a schedule and stick to it. This could include setting regular work hours and taking breaks throughout the day. Thirdly, it is important to prioritize tasks and focus on the most important tasks first. Lastly, it is important to take regular breaks throughout the day to", "metadata": {}}
5
+ {"answer_id": "aTmZw5oPVZ6KZJGwTNFWSL", "model_id": "Alpaca-LoRA-7B", "question_id": 5, "text": "Quantum computing is a type of computing that uses quantum-mechanical phenomena, such as superposition and entanglement, to perform operations on data. It uses quantum bits, or qubits, which can exist in multiple states at the same time, unlike traditional bits which can only exist in one of two states. This allows quantum computers to perform operations much faster than traditional computers, as well as solve problems that traditional computers cannot.", "metadata": {}}
6
+ {"answer_id": "K2Y2nwqk78KgMYmDbcGDWj", "model_id": "Alpaca-LoRA-7B", "question_id": 6, "text": "The main difference between plant-based and animal-based protein sources is the source of the protein. Plant-based proteins are derived from plants, such as legumes, nuts, and grains, while animal-based proteins are derived from animals, such as fish, poultry, and meat. Plant-based proteins tend to be lower in fat and cholesterol, while animal-based proteins tend to be higher in fat and cholesterol. Plant-based proteins also tend to be higher in fiber, while animal-based proteins tend to be higher in essential amino ac", "metadata": {}}
7
+ {"answer_id": "dRRb8vAo6EMgpzBWWHX9Gz", "model_id": "Alpaca-LoRA-7B", "question_id": 7, "text": "Developing critical thinking skills requires practice and dedication. Some ways to do this include reading widely, engaging in open-ended discussions, challenging your own assumptions, and asking questions.", "metadata": {}}
8
+ {"answer_id": "iuA5KruJiKBCakFxSVLiNP", "model_id": "Alpaca-LoRA-7B", "question_id": 8, "text": "The major challenges faced by the education sector today include a lack of access to quality education, a shortage of qualified teachers, inadequate infrastructure, and a lack of resources.", "metadata": {}}
9
+ {"answer_id": "7KUaVpCZDDMP5zrY9LGPS2", "model_id": "Alpaca-LoRA-7B", "question_id": 9, "text": "The primary factors that influence consumer behavior are psychological, social, cultural, economic, technological, and environmental factors. Psychological factors include consumer perceptions, attitudes, and beliefs. Social factors include family, friends, and peers. Cultural factors include values, beliefs, and customs. Economic factors include income, savings, and spending habits. Technological factors include advances in technology, such as the internet and mobile devices. Environmental factors include natural disasters and climate change.", "metadata": {}}
10
+ {"answer_id": "mbNP7b26ZxvUKYdDQJNEmF", "model_id": "Alpaca-LoRA-7B", "question_id": 10, "text": "The most effective strategies for conflict resolution in the workplace include open communication, active listening, empathy, problem-solving, compromise, and collaboration.", "metadata": {}}
11
+ {"answer_id": "eiaSqiqJkff7YHjKdpDKuw", "model_id": "Alpaca-LoRA-7B", "question_id": 11, "text": "The potential implications of using a single-use plastic bottle versus a reusable bottle on both the environment and human health include: \n\n1. Single-use plastic bottles are typically made from petroleum-based plastics, which are non-biodegradable and can take hundreds of years to break down. Reusable bottles, on the other hand, are typically made from more sustainable materials such as aluminum, glass, or stainless steel, which are biodegradable and can be recycled. \n\n2. Single-use plastic", "metadata": {}}
12
+ {"answer_id": "8nxRGH3uxN7B96AFayVbYS", "model_id": "Alpaca-LoRA-7B", "question_id": 12, "text": "When designing an inclusive and accessible public transportation system, it is important to consider factors such as accessibility for people with disabilities, accessibility for people with limited mobility, accessibility for people with visual impairments, accessibility for people with hearing impairments, accessibility for people with cognitive impairments, accessibility for people with language barriers, accessibility for people with cultural barriers, and accessibility for people with economic barriers.", "metadata": {}}
13
+ {"answer_id": "WuxBdo8LPTNaNUZp7DPD7L", "model_id": "Alpaca-LoRA-7B", "question_id": 13, "text": "Governments can utilize fiscal and monetary policies to combat economic recessions. Fiscal policies such as tax cuts and spending increases can be used to stimulate the economy. Monetary policies such as lowering interest rates and increasing the money supply can also be used to stimulate the economy.", "metadata": {}}
14
+ {"answer_id": "jCpgHGUGqPSnfXer6BCU8D", "model_id": "Alpaca-LoRA-7B", "question_id": 14, "text": "Language and cultural barriers can have a significant impact on the way people communicate and form relationships in multicultural societies. Language barriers can make it difficult for people to understand each other, which can lead to miscommunication and misunderstandings. Cultural barriers can make it difficult for people to relate to each other, as they may have different values, beliefs, and customs. This can lead to a lack of trust and understanding, which can make it difficult to form meaningful relationships.", "metadata": {}}
15
+ {"answer_id": "8Bdq3R7aH3C2T7aafjVz7L", "model_id": "Alpaca-LoRA-7B", "question_id": 15, "text": "Artificial intelligence can be used to improve the quality and efficiency of healthcare delivery in a variety of ways. For example, AI can be used to automate mundane and repetitive tasks, such as data entry and record keeping. AI can also be used to analyze large amounts of data quickly and accurately, allowing healthcare providers to make more informed decisions about patient care. Additionally, AI can be used to develop personalized treatments for individual patients, based on their medical history, lifestyle, and genetic makeup. Finally, AI can be used to monitor patients remotely", "metadata": {}}
16
+ {"answer_id": "Bn96tFqQoE8WLVGfzXZQif", "model_id": "Alpaca-LoRA-7B", "question_id": 16, "text": "Gene editing using CRISPR-Cas9 is a revolutionary technology that allows scientists to make precise changes to the genetic code of an organism. It works by introducing a guide RNA molecule into a cell, which directs the Cas9 protein to a specific location in the genome. The Cas9 protein then cuts the DNA at that location, allowing the cell to repair the cut and insert a new DNA sequence. This process can be used to correct genetic mutations, introduce new genes, or delete existing genes. \n\nGene editing using CRISPR-C", "metadata": {}}
17
+ {"answer_id": "LWDEx3WdL2GFCmLsV3cn8E", "model_id": "Alpaca-LoRA-7B", "question_id": 17, "text": "Vaccinations work to protect individuals and communities from infectious diseases by stimulating the body's immune system to produce antibodies against a particular disease. These antibodies help the body recognize and fight off the disease if it is encountered in the future. Herd immunity is a phenomenon that occurs when a certain percentage of a population is vaccinated against a particular disease. This protects the entire population, even those who have not been vaccinated, by preventing the spread of the disease.", "metadata": {}}
18
+ {"answer_id": "Y3oyHchUVhxnQSupZ2vd4d", "model_id": "Alpaca-LoRA-7B", "question_id": 18, "text": "Social media platforms have had a significant impact on the way people consume and share news. On the one hand, these platforms have made it easier for people to access a wide range of news sources, allowing them to stay up to date on current events. On the other hand, these platforms have also made it easier for misinformation to spread, as people are more likely to share content that reinforces their existing beliefs and biases. This can lead to the spread of false or misleading information, which can have serious implications for the spread of misinformation.", "metadata": {}}
19
+ {"answer_id": "K9g5uaLSNevBn7kwqySCGb", "model_id": "Alpaca-LoRA-7B", "question_id": 19, "text": "Cultural, social, and economic factors can influence people's food choices in a variety of ways. For example, a person's cultural background may influence the types of foods they are accustomed to eating. Social factors, such as peer pressure, can also influence a person's food choices. Additionally, economic factors, such as cost, availability, and access to healthy foods, can play a role in a person's food choices. Knowledge of these factors can be used to promote healthier diets. For example, educating people about the importance of eating a balanced di", "metadata": {}}
20
+ {"answer_id": "jXmEeFdkDPyNqZvWpj8qQu", "model_id": "Alpaca-LoRA-7B", "question_id": 20, "text": "Natural selection is the process by which certain traits become more or less common in a population over time. It occurs when organisms with certain traits are more likely to survive and reproduce than those with different traits. Over time, these traits become more common in the population, leading to the evolution of new species.", "metadata": {}}
21
+ {"answer_id": "YyRC7ehULJCDmBKE7s5iGb", "model_id": "Alpaca-LoRA-7B", "question_id": 21, "text": "Greetings, noble lords and ladies! I am Sir John, a knight of the realm, and I am honored to be here at your royal banquet.", "metadata": {}}
22
+ {"answer_id": "fNReuJBdGbrac32aM8sTfU", "model_id": "Alpaca-LoRA-7B", "question_id": 22, "text": "As a pirate captain, I would say to my crew, \"Treasure awaits us! Let's set sail and find our fortune!\"", "metadata": {}}
23
+ {"answer_id": "YNPBaXgMB4juQ2wdk3VKLB", "model_id": "Alpaca-LoRA-7B", "question_id": 23, "text": "If I were a Shakespearean character, I would declare my love for someone in a soliloquy by expressing my undying devotion and passion for them. I would speak of the depths of my love and how I would do anything to make them happy. I would speak of the beauty of their soul and the joy they bring to my life. I would speak of the strength of our bond and how nothing could ever break it. I would speak of the future we could have together and how I would do anything to make it a reality.", "metadata": {}}
24
+ {"answer_id": "2qHH7cn4SjRwsvtBFoFxgw", "model_id": "Alpaca-LoRA-7B", "question_id": 24, "text": "As a superhero, my origin story is a bit different than most. I was born with special powers, but I didn't realize it until I was much older. One day, I stumbled upon a mysterious artifact that unlocked my true potential. With the help of my mentor, I was able to harness my powers and use them for good.", "metadata": {}}
25
+ {"answer_id": "6xKwJSPpgXLmpJ4vUBYWux", "model_id": "Alpaca-LoRA-7B", "question_id": 25, "text": "I would tell people about the advancements in artificial intelligence, robotics, nanotechnology, and biotechnology. I would also tell them about the advancements in renewable energy sources, such as solar, wind, and hydroelectric power. Additionally, I would tell them about the advancements in medical technology, such as gene therapy and robotic surgery.", "metadata": {}}
26
+ {"answer_id": "grBskKviATfKayxhPYF8Dp", "model_id": "Alpaca-LoRA-7B", "question_id": 26, "text": "In the final seconds of the championship game, the winning play was a perfect pass from the quarterback to the wide receiver in the end zone for the game-winning touchdown!", "metadata": {}}
27
+ {"answer_id": "kt3r4KegErXg9A2sHp7sA6", "model_id": "Alpaca-LoRA-7B", "question_id": 27, "text": "My signature dish is a delectable blend of flavors and textures. It starts with a savory base of roasted vegetables and aromatic herbs, then is topped with a creamy cheese sauce and finished with a crunchy breadcrumb topping. The result is a mouth-watering dish that is sure to please any palate.", "metadata": {}}
28
+ {"answer_id": "JxjybHHSRttTSLowNvidAd", "model_id": "Alpaca-LoRA-7B", "question_id": 28, "text": "At the summit of Mount Everest, I felt an overwhelming sense of accomplishment and joy. The view from the top was breathtaking, with a panoramic view of the Himalayas and the Tibetan Plateau. I was filled with a sense of awe and appreciation for the beauty of nature.", "metadata": {}}
29
+ {"answer_id": "Hy9bdxWbAhi9bZfTcVvfgs", "model_id": "Alpaca-LoRA-7B", "question_id": 29, "text": "As a space colonist on Mars, my daily life revolves around the challenges of living on another planet. I wake up early in the morning to tend to my crops and livestock, and then spend the rest of the day exploring the vast Martian landscape. I must be mindful of the extreme temperatures and lack of oxygen, as well as the risk of radiation exposure. I must also be mindful of the limited resources available to me, as I must rely on my own ingenuity and resourcefulness to survive.", "metadata": {}}
30
+ {"answer_id": "nj3bCxENHfvDGZxjmZEWpk", "model_id": "Alpaca-LoRA-7B", "question_id": 30, "text": "I am a character in a post-apocalyptic world. I survive by scavenging for food, water, and supplies in the ruins of the old world. I also rely on my wits and knowledge of the old world to help me survive. I have encountered many allies in my travels, including other survivors, scavengers, and even wild animals.", "metadata": {}}
31
+ {"answer_id": "hGj2d3wA4PBRStU5ykku8K", "model_id": "Alpaca-LoRA-7B", "question_id": 31, "text": "You can determine if a restaurant is popular among locals or mainly attracts tourists by looking at the customer demographics. If the majority of customers are from the local area, then the restaurant is likely popular among locals. If the majority of customers are from outside the local area, then the restaurant is likely mainly attracting tourists. This information is useful because it can help you decide which restaurants are worth visiting and which ones to avoid.", "metadata": {}}
32
+ {"answer_id": "aod853iCR6JziroC44oiPy", "model_id": "Alpaca-LoRA-7B", "question_id": 32, "text": "Some subtle clues that suggest someone is pretending to understand a topic or conversation when they are actually confused or uninformed include: \n1. Making vague or general statements instead of specific ones. \n2. Avoiding direct questions and changing the subject. \n3. Using jargon or technical terms that they don't fully understand. \n4. Asking for clarification when they already have a basic understanding of the topic. \n5. Making statements that are not backed up by evidence or facts. \n6. Speaking in a condescending or patronizing", "metadata": {}}
33
+ {"answer_id": "PBfKyuJwJJj3prgBujiFz2", "model_id": "Alpaca-LoRA-7B", "question_id": 33, "text": "Someone might choose to use a paper map or ask for directions instead of relying on a GPS device or smartphone app for a variety of reasons. For example, a paper map or directions may be more accurate than a GPS device or smartphone app. Additionally, paper maps and directions may be easier to read and understand than a GPS device or smartphone app. Finally, paper maps and directions may be more cost-effective than a GPS device or smartphone app.", "metadata": {}}
34
+ {"answer_id": "UZqVMozBmqynyuNms4uZRp", "model_id": "Alpaca-LoRA-7B", "question_id": 34, "text": "One way to determine if a person is genuinely interested in a conversation or simply being polite is to observe their body language. If they are making eye contact, smiling, and leaning in towards you, they are likely interested in the conversation. If they are fidgeting, looking away, and avoiding direct eye contact, they may be simply being polite.", "metadata": {}}
35
+ {"answer_id": "d9fhXhFNgxE3A3ze52cSfU", "model_id": "Alpaca-LoRA-7B", "question_id": 35, "text": "Someone might prefer to shop at a small, locally-owned business instead of a large chain store, even if the prices are higher, because they want to support their local community and economy. They may also prefer the personalized customer service and the unique products that a small business can offer.", "metadata": {}}
36
+ {"answer_id": "bcqCSS6kVAuUWsTSsVzf7n", "model_id": "Alpaca-LoRA-7B", "question_id": 36, "text": "When assessing the credibility of a source of information, it is important to look beyond the reputation of the author or publisher. One way to do this is to look at the sources used in the article or blog post. If the sources are reliable and trustworthy, then the article or blog post is likely to be reliable and trustworthy as well. Additionally, it is important to look at the language used in the article or blog post. If the language is clear, concise, and factual, then the article or blog post is likely to be reliable and trustworthy. Finally, it is important to look", "metadata": {}}
37
+ {"answer_id": "6MXs63WkE4Lj2g87WF4HxL", "model_id": "Alpaca-LoRA-7B", "question_id": 37, "text": "Some people enjoy the sensation of being scared, such as by watching horror movies or going on roller coasters, because it provides an adrenaline rush and a sense of excitement. Others avoid these experiences because they are uncomfortable and make them feel anxious.", "metadata": {}}
38
+ {"answer_id": "RTZ4vXXt438bpNFXrXZTDj", "model_id": "Alpaca-LoRA-7B", "question_id": 38, "text": "Observing the behavior of other people in a social situation can provide clues about cultural norms and expectations. For example, in some cultures, it is expected that people will greet each other with a handshake, while in other cultures, it is expected that people will greet each other with a hug or a kiss on the cheek. Additionally, observing the behavior of other people in a social situation can provide clues about how people interact with each other. For example, in some cultures, it is expected that people will engage in small talk, while in other cultures, it", "metadata": {}}
39
+ {"answer_id": "3FQrL4zsGAzbe8XnXZnWYR", "model_id": "Alpaca-LoRA-7B", "question_id": 39, "text": "We do have a moral obligation to explore space, as it could lead to new discoveries that could benefit humanity. However, it is also important to focus on solving Earth's problems first.", "metadata": {}}
40
+ {"answer_id": "4dDWnLzvKmJ4LhAU9W9CTB", "model_id": "Alpaca-LoRA-7B", "question_id": 40, "text": "It is important to prioritize both job creation and technological progress in a world where automation is becoming increasingly prevalent. Job creation is essential to maintaining a healthy economy, while technological progress is necessary to remain competitive in the global marketplace.", "metadata": {}}
41
+ {"answer_id": "ct9sMyRswWurPU95adtSWG", "model_id": "Alpaca-LoRA-7B", "question_id": 41, "text": "The average human blinks around 12,000 to 15,000 times in a lifetime. This is because blinking is a natural reflex that helps to keep the eyes lubricated and clean. Blinking also helps to protect the eyes from dust, debris, and other foreign objects.", "metadata": {}}
42
+ {"answer_id": "4vPHhTHHWWi78Rqpnof6hV", "model_id": "Alpaca-LoRA-7B", "question_id": 42, "text": "A grain of salt is made up of millions of atoms. Each atom is composed of three subatomic particles: protons, neutrons, and electrons. The number of protons, neutrons, and electrons in a grain of salt depends on the type of salt. For example, table salt has 12 protons, 12 neutrons, and 12 electrons, while sea salt has 14 protons, 14 neutrons, and 14 electrons. The total number of atoms in a grain of salt is determined by multiplying the number of protons, neutrons, and", "metadata": {}}
43
+ {"answer_id": "JdCNS2ZogsBALjUXkH2RZa", "model_id": "Alpaca-LoRA-7B", "question_id": 43, "text": "On average, 100 lightning strikes occur on Earth each day. Lightning is caused by the collision of electrically charged particles in the atmosphere. When these particles collide, they create an electrical discharge in the form of a lightning bolt. Lightning is most likely to occur during thunderstorms, when there is a lot of moisture in the atmosphere. Lightning is also more likely to occur during the summer months, when the atmosphere is warmer and more unstable.", "metadata": {}}
44
+ {"answer_id": "TdA9XnHqWMV8ZvR8JHBCKY", "model_id": "Alpaca-LoRA-7B", "question_id": 44, "text": "It would take a lot of balloons to lift a house like in the movie \"Up\". First, we would need to calculate the weight of the house. Then, we would need to calculate the volume of the balloons needed to lift the house. Finally, we would need to calculate the number of balloons needed to lift the house.", "metadata": {}}
45
+ {"answer_id": "AzfzD5NzJuFf975ebcJWBg", "model_id": "Alpaca-LoRA-7B", "question_id": 45, "text": "The number of text messages sent globally in a minute is estimated to be around 20 billion. This is due to the increasing popularity of smartphones and the widespread use of messaging apps. Smartphones have made it easier for people to stay in touch with friends and family, and messaging apps have made it even easier to send and receive text messages. This has led to an increase in the number of text messages sent globally in a minute.", "metadata": {}}
46
+ {"answer_id": "KFSK3H97PMne4rERquEjn7", "model_id": "Alpaca-LoRA-7B", "question_id": 46, "text": "It is estimated that around 173 million words are spoken daily on Earth. This number is based on the average number of words spoken per person per day, which is estimated to be around 16,000 words.", "metadata": {}}
47
+ {"answer_id": "JgsjVHk2XU2fN7V3Rjsfhx", "model_id": "Alpaca-LoRA-7B", "question_id": 47, "text": "During a typical winter, it is estimated that around 10 billion snowflakes fall. This is because snowflakes form when water vapor in the atmosphere freezes into ice crystals. The amount of snowflakes that fall depends on the temperature and humidity of the air, as well as the amount of water vapor in the atmosphere.", "metadata": {}}
48
+ {"answer_id": "E5b659KAPPABQx9crDc9yR", "model_id": "Alpaca-LoRA-7B", "question_id": 48, "text": "It is impossible to know exactly how many pages are in all the books ever written. However, we can make an educated guess by looking at the number of books published each year. According to the United Nations Educational, Scientific and Cultural Organization (UNESCO), approximately 250,000 books are published each year. If we assume that each book has an average of 300 pages, then we can estimate that there are approximately 75 million pages in all the books ever written.", "metadata": {}}
49
+ {"answer_id": "ExNLQLnvty3V5ydnXGQFQ9", "model_id": "Alpaca-LoRA-7B", "question_id": 49, "text": "The Earth has orbited the Sun 4.54 billion times since the beginning of life. This can be calculated by multiplying the number of years since the beginning of life (4.54 billion) by the number of days in a year (365.25 days).", "metadata": {}}
50
+ {"answer_id": "ATRgQiKPgm8a6LRkitAfLE", "model_id": "Alpaca-LoRA-7B", "question_id": 50, "text": "It is difficult to estimate the exact number of songs that have been recorded throughout history, but it is safe to say that the number is in the millions. This is due to the fact that music has been a part of human culture for thousands of years and has been passed down from generation to generation through oral tradition. Additionally, the invention of recording technology has made it easier for musicians to create and share their music with the world.", "metadata": {}}
51
+ {"answer_id": "2CKKcM7bLn9efCLCPnX8Ur", "model_id": "Alpaca-LoRA-7B", "question_id": 51, "text": "If the Internet had been invented during the Renaissance period, it would have likely been used for the same purposes as it is today, such as communication, research, and entertainment. However, it would likely have been used in a much different way than it is today. For example, it would likely have been used by scholars and scientists to share information and collaborate on research projects. Additionally, it would likely have been used by artists and musicians to share their creations with the world.", "metadata": {}}
52
+ {"answer_id": "PdyB3VZQq3KssodCxv9JSe", "model_id": "Alpaca-LoRA-7B", "question_id": 52, "text": "If the Aztecs had successfully repelled the Spanish conquistadors, it is likely that the Aztec Empire would have remained intact and the Spanish would not have been able to colonize the region. The Aztecs would have been able to maintain their culture and traditions, and the Spanish would not have been able to exploit the region's resources.", "metadata": {}}
53
+ {"answer_id": "DfXLmeC2NXXLRwNYKAjLMR", "model_id": "Alpaca-LoRA-7B", "question_id": 53, "text": "If the Black Death had not occurred in the 14th century, it is likely that the population of Europe would have been much higher than it is today. This would have had a significant impact on the economy, culture, and politics of the time.", "metadata": {}}
54
+ {"answer_id": "68EwmJL2yK2n7UrHqVhSzS", "model_id": "Alpaca-LoRA-7B", "question_id": 54, "text": "If Isaac Newton had focused on biology instead of physics, it is likely that he would have made significant contributions to the field of biology. He would have been able to apply his knowledge of mathematics, physics, and mechanics to the study of living organisms. This could have led to the development of new theories and discoveries in the field of biology.", "metadata": {}}
55
+ {"answer_id": "baeBdC3m82V8pP9xpRvVgL", "model_id": "Alpaca-LoRA-7B", "question_id": 55, "text": "If the Beatles had never formed as a band, it is likely that they would have gone their separate ways and pursued different careers. John Lennon would likely have become a successful solo artist, while Paul McCartney, George Harrison, and Ringo Starr would have likely formed other bands or pursued solo careers.", "metadata": {}}
56
+ {"answer_id": "bior4Xdd6iM7yKTVvozqzp", "model_id": "Alpaca-LoRA-7B", "question_id": 56, "text": "If Alan Turing had not cracked the Enigma code during World War II, the outcome of the war could have been drastically different. The Allies would have been unable to decipher the encrypted messages sent by the Axis powers, making it much more difficult for them to plan and execute their strategies. Without the Enigma code being cracked, it is likely that the Allies would have lost the war.", "metadata": {}}
57
+ {"answer_id": "eARcDASRk8erkCzxy5WFQY", "model_id": "Alpaca-LoRA-7B", "question_id": 57, "text": "If the Suez Canal had never been constructed, it is likely that trade between Europe and Asia would have been much slower and more expensive. This would have had a significant impact on the economies of both regions.", "metadata": {}}
58
+ {"answer_id": "kvoFSX6e3KM93SPQUhJ4zq", "model_id": "Alpaca-LoRA-7B", "question_id": 58, "text": "If the Maya civilization had never mysteriously collapsed, it is likely that they would have continued to flourish and develop their culture and technology. The Maya civilization had a sophisticated knowledge of mathematics, astronomy, and agriculture, and it is likely that they would have continued to advance in these areas. Additionally, the Maya civilization had an advanced writing system, and it is likely that they would have continued to develop their language and literature.", "metadata": {}}
59
+ {"answer_id": "5MnJTUos6Tb4RY3hTDqpTQ", "model_id": "Alpaca-LoRA-7B", "question_id": 59, "text": "If Christopher Columbus had not discovered the Americas, it is likely that other European explorers would have eventually made the journey. However, it is impossible to know what the consequences of this would have been.", "metadata": {}}
60
+ {"answer_id": "eZLkNPLCKgjXT58zshNGNu", "model_id": "Alpaca-LoRA-7B", "question_id": 60, "text": "If Vincent van Gogh had been a successful artist during his lifetime, his paintings would have been valued much higher than they are today. He would have been able to make a living from his art and would have been able to support himself and his family.", "metadata": {}}
61
+ {"answer_id": "2RnFdbESWUwrJghbUv78Eo", "model_id": "Alpaca-LoRA-7B", "question_id": 61, "text": "#include <iostream>\n#include <fstream>\n#include <string>\n#include <cstdlib>\n\nusing namespace std;\n\nint main()\n{\n ifstream file;\n string word;\n int count = 0;\n\n file.open(\"file.txt\");\n if (file.is_open())\n {\n while (getline(file, word))\n {\n if (word.find(word)!= string::npos)\n {\n count++;\n }\n }\n cout", "metadata": {}}
62
+ {"answer_id": "8QDgPvQK3cSZKUrAHUjEvM", "model_id": "Alpaca-LoRA-7B", "question_id": 62, "text": "def longest_common_subsequence(s1, s2):\n \"\"\"\n Function to find the longest common subsequence of two strings using dynamic programming.\n\n :param s1: First string\n :type s1: str\n :param s2: Second string\n :type s2: str\n :return: Length of the longest common subsequence\n :rtype: int\n \"\"\"\n if len(s1) == 0 or len(s2) == 0:\n return 0\n elif s1 == s2:", "metadata": {}}
63
+ {"answer_id": "jB4dbzWVmgj3SDp7JWhdCF", "model_id": "Alpaca-LoRA-7B", "question_id": 63, "text": "import re\n\ndef validate_email(email):\n pattern = re.compile(r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,3}$')\n return pattern.match(email) is not None\n\nif __name__ == '__main__':\n print(validate_email('[email protected]'))\n print(validate_email('user_example.com'))\n print(validate_email('user+example.com'))", "metadata": {}}
64
+ {"answer_id": "cjEESwpbcpcGMXHfWxUx2q", "model_id": "Alpaca-LoRA-7B", "question_id": 64, "text": "def Fibonacci(n):\n if n == 0:\n return 0\n elif n == 1:\n return 1\n else:\n return Fibonacci(n-1) + Fibonacci(n-2)", "metadata": {}}
65
+ {"answer_id": "n6ffFETFrVRRisxjaHnBez", "model_id": "Alpaca-LoRA-7B", "question_id": 65, "text": "def binary_search(arr, target):\n low = 0\n high = len(arr) - 1\n while low <= high:\n mid = (low + high) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n low = mid + 1\n else:\n high = mid - 1\n return -1", "metadata": {}}
66
+ {"answer_id": "6VaPFsoBZxnisVv5brpZSY", "model_id": "Alpaca-LoRA-7B", "question_id": 66, "text": "class Queue:\n def __init__(self):\n self.front = None\n self.back = None\n\n def enqueue(self, item):\n if self.front is None:\n self.front = self.back = item\n else:\n self.back = item\n\n def dequeue(self):\n if self.front is None:\n return None\n else:\n return self.front\n\n def peek(self):\n if self.front is None:\n return None\n else:", "metadata": {}}
67
+ {"answer_id": "JDnxgW2wczAhJ9Z4aZDYQ9", "model_id": "Alpaca-LoRA-7B", "question_id": 67, "text": "The following program can be used to find the common elements in two arrays without using any extra data structures:\n\ndef findCommonElements(arr1, arr2):\n commonElements = []\n for i in range(len(arr1)):\n for j in range(len(arr2)):\n if arr1[i] == arr2[j]:\n commonElements.append(arr1[i])\n break\n return commonElements\n\nif __name__ == '__main__':\n arr1 = [1, 2, 3, 4,", "metadata": {}}
68
+ {"answer_id": "Qp2SHVTA2BGa6F9WfMfoZT", "model_id": "Alpaca-LoRA-7B", "question_id": 68, "text": "7", "metadata": {}}
69
+ {"answer_id": "oNgjBw6XdvAesCzfkGSuxN", "model_id": "Alpaca-LoRA-7B", "question_id": 69, "text": "x = 2", "metadata": {}}
70
+ {"answer_id": "Xc7tmWSdfVPDPggewgHNWR", "model_id": "Alpaca-LoRA-7B", "question_id": 70, "text": "The length of the line segment is 8 units.", "metadata": {}}
71
+ {"answer_id": "b8hdG9YfuoUQbRpDn7cwWG", "model_id": "Alpaca-LoRA-7B", "question_id": 71, "text": "Subject: Proposal for a Joint Venture\n\nDear [Name],\n\nI am writing to propose a joint venture between our two companies. We believe that our combined expertise and resources can create a powerful partnership that will benefit both of our businesses. \n\nOur company has extensive experience in the field of [field], and we are confident that our knowledge and resources can be leveraged to create a successful venture. \n\nWe would be happy to discuss the details of our proposal and answer any questions you may have. \n\nThank you for your time and consideration.", "metadata": {}}
72
+ {"answer_id": "3xqeLJ8Qm6hwWhEvziSBFQ", "model_id": "Alpaca-LoRA-7B", "question_id": 72, "text": "Dear [Employer], \n\nI am writing to inform you that I am resigning from my position as [Job Title] at [Company Name]. It has been a pleasure working with you and I am grateful for the opportunities you have provided me. \n\nI am confident that I am leaving the company in a better place than when I joined, and I am proud of the work I have done. I wish you and the team all the best in the future. \n\nSincerely, \n[Your Name]", "metadata": {}}
73
+ {"answer_id": "AbN78yGBnPtNHAhh2PDT82", "model_id": "Alpaca-LoRA-7B", "question_id": 73, "text": "Dear Admissions Committee,\n\nI am writing to recommend [Name] for admission to your prestigious graduate program in computer science. I have known [Name] for the past two years as a student in my undergraduate computer science course. During this time, I have been impressed with [Name]'s dedication and passion for the field of computer science. [Name] has consistently demonstrated a strong understanding of the material, as well as a creative and innovative approach to problem-solving. [Name] has also been an active contributor to our class discussions and has", "metadata": {}}
74
+ {"answer_id": "jB4XhrHhH6mFBkKUr7XLWh", "model_id": "Alpaca-LoRA-7B", "question_id": 74, "text": "Dear Valued Customers, \n\nWe are excited to announce the launch of our new software solution, which is designed to revolutionize the way you do business. Our software is designed to streamline processes, increase productivity, and reduce costs. \n\nOur software is easy to use and can be customized to meet your specific needs. It is designed to be intuitive and user-friendly, so you can start using it right away. \n\nWe are confident that our software will help you reach your goals faster and more efficiently than ever before. \n\nWe look forward to hearing your", "metadata": {}}
75
+ {"answer_id": "Pq9xZKbu3TRHLE8h5cemW9", "model_id": "Alpaca-LoRA-7B", "question_id": 75, "text": "Dear Customer, \n\nWe apologize for the delay in your order. We understand that this can be frustrating, and we want to assure you that we have taken steps to ensure that this does not happen again. \n\nOur team is working hard to ensure that all orders are processed in a timely manner, and we appreciate your patience. \n\nAgain, we apologize for the inconvenience and thank you for your understanding. \n\nSincerely, \n[Your Name]", "metadata": {}}
76
+ {"answer_id": "ZiJnw5Z62Krxivgbp5RdHc", "model_id": "Alpaca-LoRA-7B", "question_id": 76, "text": "Welcome to a journey through the history and cultural significance of jazz! Jazz has been an important part of American culture since the early 20th century, and its influence has spread around the world. In this video, we'll explore the origins of jazz, its evolution over the decades, and its impact on modern music. We'll also look at how jazz has been embraced by different cultures, and how it has been used to express a wide range of emotions. Let's get started!", "metadata": {}}
77
+ {"answer_id": "TMGotUvab3hNQabKsLWBtj", "model_id": "Alpaca-LoRA-7B", "question_id": 77, "text": "My recent trip to Hawaii was an unforgettable experience. I had the chance to explore the islands and experience the unique culture of the Aloha State. From the lush rainforests of Kauai to the vibrant nightlife of Honolulu, there was so much to see and do. \n\nOne of the highlights of my trip was a visit to the Polynesian Cultural Center in Oahu. Here, I was able to learn about the traditions and customs of the Polynesian people. I also had the opportunity to watch a traditional Samoan fire-knife dance", "metadata": {}}
78
+ {"answer_id": "WjLGwi4t8mnMZzeg9TeEkj", "model_id": "Alpaca-LoRA-7B", "question_id": 78, "text": "I recently watched the new science fiction film, and it was absolutely captivating! The plot was full of twists and turns that kept me on the edge of my seat. The characters were well-developed and believable, and the special effects were top-notch. Overall, I highly recommend this film to anyone who loves science fiction.", "metadata": {}}
79
+ {"answer_id": "DvxvdW2ux6tvjKWpBFBnJb", "model_id": "Alpaca-LoRA-7B", "question_id": 79, "text": "Hello and welcome to the Streaming Revolution podcast! In this episode, we'll be discussing the impact of streaming platforms on the music industry. We'll be talking about how streaming platforms have changed the way people listen to music, how streaming has changed the economics of the music industry, and how streaming has changed the way artists create and market their music. We'll also be discussing the implications of streaming for the future of the music industry. So, let's get started!", "metadata": {}}
80
+ {"answer_id": "SyrMXq93QntXjxoUgDDECf", "model_id": "Alpaca-LoRA-7B", "question_id": 80, "text": "Last night, I had the pleasure of attending a symphony concert at the local concert hall. The orchestra was comprised of some of the most talented musicians I have ever seen, and their performance was nothing short of spectacular. From the opening notes of the first piece, the audience was captivated by the orchestra's masterful execution of the music. Each piece was performed with precision and passion, and the audience was left in awe of the orchestra's skill and dedication to their craft. Overall, the symphony concert was a wonderful experience and I would highly recommend it to", "metadata": {}}
app.py ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ import glob
4
+ import sys
5
+ import time
6
+ from pathlib import Path
7
+ from typing import Tuple
8
+
9
+ from huggingface_hub import hf_hub_download
10
+ from PIL import Image
11
+ import gradio as gr
12
+ import torch
13
+ from fairscale.nn.model_parallel.initialize import initialize_model_parallel
14
+
15
+ from llama import LLaMA, ModelArgs, Tokenizer, Transformer, VisionModel
16
+
17
+ os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
18
+
19
+ PROMPT_DICT = {
20
+ "prompt_input": (
21
+ "Below is an instruction that describes a task, paired with an input that provides further context. "
22
+ "Write a response that appropriately completes the request.\n\n"
23
+ "### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:"
24
+ ),
25
+ "prompt_no_input": (
26
+ "Below is an instruction that describes a task. "
27
+ "Write a response that appropriately completes the request.\n\n"
28
+ "### Instruction:\n{instruction}\n\n### Response:"
29
+ ),
30
+ }
31
+
32
+
33
+ def setup_model_parallel() -> Tuple[int, int]:
34
+ os.environ['RANK'] = '0'
35
+ os.environ['WORLD_SIZE'] = '1'
36
+ os.environ['MP'] = '1'
37
+ os.environ['MASTER_ADDR'] = '127.0.0.1'
38
+ os.environ['MASTER_PORT'] = '2223'
39
+ local_rank = int(os.environ.get("LOCAL_RANK", -1))
40
+ world_size = int(os.environ.get("WORLD_SIZE", -1))
41
+
42
+ torch.distributed.init_process_group("nccl")
43
+ initialize_model_parallel(world_size)
44
+ torch.cuda.set_device(local_rank)
45
+
46
+ # seed must be the same in all processes
47
+ torch.manual_seed(1)
48
+ return local_rank, world_size
49
+
50
+
51
+ def load(
52
+ ckpt0_path: str,
53
+ ckpt1_path: str,
54
+ param_path: str,
55
+ tokenizer_path: str,
56
+ instruct_adapter_path: str,
57
+ caption_adapter_path: str,
58
+ local_rank: int,
59
+ world_size: int,
60
+ max_seq_len: int,
61
+ max_batch_size: int,
62
+ ) -> LLaMA:
63
+ start_time = time.time()
64
+ print("Loading")
65
+ instruct_adapter_checkpoint = torch.load(
66
+ instruct_adapter_path, map_location="cpu")
67
+ caption_adapter_checkpoint = torch.load(
68
+ caption_adapter_path, map_location="cpu")
69
+ with open(param_path, "r") as f:
70
+ params = json.loads(f.read())
71
+
72
+ model_args: ModelArgs = ModelArgs(
73
+ max_seq_len=max_seq_len, max_batch_size=max_batch_size, **params
74
+ )
75
+ model_args.adapter_layer = int(
76
+ instruct_adapter_checkpoint['adapter_query.weight'].shape[0] / model_args.adapter_len)
77
+ model_args.cap_adapter_layer = int(
78
+ caption_adapter_checkpoint['cap_adapter_query.weight'].shape[0] / model_args.cap_adapter_len)
79
+
80
+ tokenizer = Tokenizer(model_path=tokenizer_path)
81
+ model_args.vocab_size = tokenizer.n_words
82
+ torch.set_default_tensor_type(torch.cuda.HalfTensor)
83
+ model = Transformer(model_args)
84
+
85
+ # To reduce memory usuage
86
+ ckpt0 = torch.load(ckpt0_path, map_location='cuda')
87
+ model.load_state_dict(ckpt0, strict=False)
88
+ del ckpt0
89
+ torch.cuda.empty_cache()
90
+
91
+ ckpt1 = torch.load(ckpt1_path, map_location='cuda')
92
+ model.load_state_dict(ckpt1, strict=False)
93
+ del ckpt1
94
+ torch.cuda.empty_cache()
95
+
96
+ vision_model = VisionModel(model_args)
97
+
98
+ torch.set_default_tensor_type(torch.FloatTensor)
99
+ model.load_state_dict(instruct_adapter_checkpoint, strict=False)
100
+ model.load_state_dict(caption_adapter_checkpoint, strict=False)
101
+ vision_model.load_state_dict(caption_adapter_checkpoint, strict=False)
102
+
103
+ generator = LLaMA(model, tokenizer, vision_model)
104
+ print(f"Loaded in {time.time() - start_time:.2f} seconds")
105
+ return generator
106
+
107
+
108
+ def instruct_generate(
109
+ instruct: str,
110
+ input: str = 'none',
111
+ max_gen_len=512,
112
+ temperature: float = 0.1,
113
+ top_p: float = 0.75,
114
+ ):
115
+ if input == 'none':
116
+ prompt = PROMPT_DICT['prompt_no_input'].format_map(
117
+ {'instruction': instruct, 'input': ''})
118
+ else:
119
+ prompt = PROMPT_DICT['prompt_input'].format_map(
120
+ {'instruction': instruct, 'input': input})
121
+
122
+ results = generator.generate(
123
+ [prompt], max_gen_len=max_gen_len, temperature=temperature, top_p=top_p
124
+ )
125
+ result = results[0].strip()
126
+ print(result)
127
+ return result
128
+
129
+
130
+ def caption_generate(
131
+ img: str,
132
+ max_gen_len=512,
133
+ temperature: float = 0.1,
134
+ top_p: float = 0.75,
135
+ ):
136
+ imgs = [Image.open(img).convert('RGB')]
137
+ prompts = ["Generate caption of this image :",] * len(imgs)
138
+
139
+ results = generator.generate(
140
+ prompts, imgs=imgs, max_gen_len=max_gen_len, temperature=temperature, top_p=top_p
141
+ )
142
+ result = results[0].strip()
143
+ print(result)
144
+ return result
145
+
146
+
147
+ def download_llama_adapter(instruct_adapter_path, caption_adapter_path):
148
+ if not os.path.exists(instruct_adapter_path):
149
+ os.system(
150
+ f"wget -q -O {instruct_adapter_path} https://github.com/ZrrSkywalker/LLaMA-Adapter/releases/download/v.1.0.0/llama_adapter_len10_layer30_release.pth")
151
+
152
+ if not os.path.exists(caption_adapter_path):
153
+ os.system(
154
+ f"wget -q -O {caption_adapter_path} https://github.com/ZrrSkywalker/LLaMA-Adapter/releases/download/v.1.0.0/llama_adapter_len10_layer30_caption_vit_l.pth")
155
+
156
+
157
+ # ckpt_path = "/data1/llma/7B/consolidated.00.pth"
158
+ # param_path = "/data1/llma/7B/params.json"
159
+ # tokenizer_path = "/data1/llma/tokenizer.model"
160
+ ckpt0_path = hf_hub_download(
161
+ repo_id="csuhan/llama_storage", filename="consolidated.00_part0.pth")
162
+ ckpt1_path = hf_hub_download(
163
+ repo_id="csuhan/llama_storage", filename="consolidated.00_part1.pth")
164
+ param_path = hf_hub_download(
165
+ repo_id="nyanko7/LLaMA-7B", filename="params.json")
166
+ tokenizer_path = hf_hub_download(
167
+ repo_id="nyanko7/LLaMA-7B", filename="tokenizer.model")
168
+ instruct_adapter_path = "llama_adapter_len10_layer30_release.pth"
169
+ caption_adapter_path = "llama_adapter_len10_layer30_caption_vit_l.pth"
170
+ max_seq_len = 512
171
+ max_batch_size = 1
172
+
173
+ # download models
174
+ # download_llama_adapter(instruct_adapter_path, caption_adapter_path)
175
+
176
+ local_rank, world_size = setup_model_parallel()
177
+ if local_rank > 0:
178
+ sys.stdout = open(os.devnull, "w")
179
+
180
+ generator = load(
181
+ ckpt0_path, ckpt1_path, param_path, tokenizer_path, instruct_adapter_path, caption_adapter_path, local_rank, world_size, max_seq_len, max_batch_size
182
+ )
183
+
184
+
185
+ def create_instruct_demo():
186
+ with gr.Blocks() as instruct_demo:
187
+ with gr.Row():
188
+ with gr.Column():
189
+ instruction = gr.Textbox(lines=2, label="Instruction")
190
+ input = gr.Textbox(
191
+ lines=2, label="Context input", placeholder='none')
192
+ max_len = gr.Slider(minimum=1, maximum=512,
193
+ value=128, label="Max length")
194
+ with gr.Accordion(label='Advanced options', open=False):
195
+ temp = gr.Slider(minimum=0, maximum=1,
196
+ value=0.1, label="Temperature")
197
+ top_p = gr.Slider(minimum=0, maximum=1,
198
+ value=0.75, label="Top p")
199
+
200
+ run_botton = gr.Button("Run")
201
+
202
+ with gr.Column():
203
+ outputs = gr.Textbox(lines=10, label="Output")
204
+
205
+ inputs = [instruction, input, max_len, temp, top_p]
206
+
207
+ examples = [
208
+ "Tell me about alpacas.",
209
+ "Write a Python program that prints the first 10 Fibonacci numbers.",
210
+ "Write a conversation between the sun and pluto.",
211
+ "Write a theory to explain why cat never existed",
212
+ ]
213
+ examples = [
214
+ [x, "none", 128, 0.1, 0.75]
215
+ for x in examples]
216
+
217
+ gr.Examples(
218
+ examples=examples,
219
+ inputs=inputs,
220
+ outputs=outputs,
221
+ fn=instruct_generate,
222
+ cache_examples=os.getenv('SYSTEM') == 'spaces'
223
+ )
224
+ run_botton.click(fn=instruct_generate, inputs=inputs, outputs=outputs)
225
+ return instruct_demo
226
+
227
+
228
+ def create_caption_demo():
229
+ with gr.Blocks() as instruct_demo:
230
+ with gr.Row():
231
+ with gr.Column():
232
+ img = gr.Image(label='Input', type='filepath')
233
+ max_len = gr.Slider(minimum=1, maximum=512,
234
+ value=64, label="Max length")
235
+ with gr.Accordion(label='Advanced options', open=False):
236
+ temp = gr.Slider(minimum=0, maximum=1,
237
+ value=0.1, label="Temperature")
238
+ top_p = gr.Slider(minimum=0, maximum=1,
239
+ value=0.75, label="Top p")
240
+
241
+ run_botton = gr.Button("Run")
242
+
243
+ with gr.Column():
244
+ outputs = gr.Textbox(lines=10, label="Output")
245
+
246
+ inputs = [img, max_len, temp, top_p]
247
+
248
+ examples = glob.glob("caption_demo/*.jpg")
249
+ examples = [
250
+ [x, 64, 0.1, 0.75]
251
+ for x in examples]
252
+
253
+ gr.Examples(
254
+ examples=examples,
255
+ inputs=inputs,
256
+ outputs=outputs,
257
+ fn=caption_generate,
258
+ cache_examples=os.getenv('SYSTEM') == 'spaces'
259
+ )
260
+ run_botton.click(fn=caption_generate, inputs=inputs, outputs=outputs)
261
+ return instruct_demo
262
+
263
+
264
+ description = """
265
+ # LLaMA-AdapterπŸš€
266
+ The official demo for **LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention**.
267
+ Please refer to our [arXiv paper](https://arxiv.org/abs/2303.16199) and [github](https://github.com/ZrrSkywalker/LLaMA-Adapter) for more details.
268
+ """
269
+
270
+ with gr.Blocks(css='style.css') as demo:
271
+ gr.Markdown(description)
272
+ with gr.TabItem("Instruction-Following"):
273
+ create_instruct_demo()
274
+ with gr.TabItem("Image Captioning"):
275
+ create_caption_demo()
276
+
277
+ demo.queue(api_open=True, concurrency_count=1).launch()
caption_demo/COCO_val2014_000000111104.jpg ADDED
caption_demo/COCO_val2014_000000111165.jpg ADDED
caption_demo/COCO_val2014_000000111179.jpg ADDED
caption_demo/COCO_val2014_000000111180.jpg ADDED
caption_demo/COCO_val2014_000000111194.jpg ADDED
caption_demo/base_logo.jpg ADDED
generate_pandalm.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+
4
+ json_path1 = "llama_adapter_7b.json"
5
+ json_path2 = "alpaca_lora_7b.json"
6
+ out_path = "llama_adapter_vs_alpaca_lora.json"
7
+
8
+ data1 = open(json_path1).readlines()
9
+ data2 = open(json_path2).readlines()
10
+ question = open('question.jsonl').readlines()
11
+
12
+ assert len(data1) == len(data2) == len(question)
13
+
14
+ out_data = []
15
+ for i, (d1, d2, q) in enumerate(zip(data1, data2, question)):
16
+ d1 = json.loads(d1)
17
+ d2 = json.loads(d2)
18
+ q = json.loads(q)
19
+ out_d = {
20
+ 'question_id': i,
21
+ 'instruction': q['text'],
22
+ 'input': '',
23
+ "response1": d1['text'],
24
+ "response2": d2['text'],
25
+ }
26
+ out_data.append(out_d)
27
+
28
+ # remove bias
29
+ for i, (d1, d2, q) in enumerate(zip(data2, data1, question)):
30
+ d1 = json.loads(d1)
31
+ d2 = json.loads(d2)
32
+ q = json.loads(q)
33
+ out_d = {
34
+ 'question_id': i+80,
35
+ 'instruction': q['text'],
36
+ 'input': '',
37
+ "response1": d1['text'],
38
+ "response2": d2['text'],
39
+ }
40
+ out_data.append(out_d)
41
+
42
+ with open(out_path, 'w') as f:
43
+ # f.write("\n".join([json.dumps(x) for x in out_data]))
44
+ json.dump(out_data, f)
gpt4_eval.py ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ import glob
4
+ import sys
5
+ import time
6
+ from pathlib import Path
7
+ from typing import Tuple
8
+
9
+ import shortuuid
10
+ # from huggingface_hub import hf_hub_download
11
+ from PIL import Image
12
+ import gradio as gr
13
+ import torch
14
+ from fairscale.nn.model_parallel.initialize import initialize_model_parallel
15
+
16
+ from llama import LLaMA, ModelArgs, Tokenizer, Transformer, VisionModel
17
+
18
+ os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
19
+
20
+ PROMPT_DICT = {
21
+ "prompt_input": (
22
+ "Below is an instruction that describes a task, paired with an input that provides further context. "
23
+ "Write a response that appropriately completes the request.\n\n"
24
+ "### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:"
25
+ ),
26
+ "prompt_no_input": (
27
+ "Below is an instruction that describes a task. "
28
+ "Write a response that appropriately completes the request.\n\n"
29
+ "### Instruction:\n{instruction}\n\n### Response:"
30
+ ),
31
+ }
32
+
33
+
34
+ def setup_model_parallel() -> Tuple[int, int]:
35
+ os.environ['RANK'] = '0'
36
+ os.environ['WORLD_SIZE'] = '1'
37
+ os.environ['MP'] = '1'
38
+ os.environ['MASTER_ADDR'] = '127.0.0.1'
39
+ os.environ['MASTER_PORT'] = '2223'
40
+ local_rank = int(os.environ.get("LOCAL_RANK", -1))
41
+ world_size = int(os.environ.get("WORLD_SIZE", -1))
42
+
43
+ torch.distributed.init_process_group("nccl")
44
+ initialize_model_parallel(world_size)
45
+ torch.cuda.set_device(local_rank)
46
+
47
+ # seed must be the same in all processes
48
+ torch.manual_seed(1)
49
+ return local_rank, world_size
50
+
51
+
52
+ def load(
53
+ ckpt_path: str,
54
+ param_path: str,
55
+ tokenizer_path: str,
56
+ instruct_adapter_path: str,
57
+ caption_adapter_path: str,
58
+ local_rank: int,
59
+ world_size: int,
60
+ max_seq_len: int,
61
+ max_batch_size: int,
62
+ ) -> LLaMA:
63
+ start_time = time.time()
64
+ print("Loading")
65
+ instruct_adapter_checkpoint = torch.load(
66
+ instruct_adapter_path, map_location="cpu")
67
+ caption_adapter_checkpoint = torch.load(
68
+ caption_adapter_path, map_location="cpu")
69
+ with open(param_path, "r") as f:
70
+ params = json.loads(f.read())
71
+
72
+ model_args: ModelArgs = ModelArgs(
73
+ max_seq_len=max_seq_len, max_batch_size=max_batch_size, **params
74
+ )
75
+ model_args.adapter_layer = int(
76
+ instruct_adapter_checkpoint['adapter_query.weight'].shape[0] / model_args.adapter_len)
77
+ model_args.cap_adapter_layer = int(
78
+ caption_adapter_checkpoint['cap_adapter_query.weight'].shape[0] / model_args.cap_adapter_len)
79
+
80
+ tokenizer = Tokenizer(model_path=tokenizer_path)
81
+ model_args.vocab_size = tokenizer.n_words
82
+ torch.set_default_tensor_type(torch.cuda.HalfTensor)
83
+ model = Transformer(model_args)
84
+
85
+ ckpt = torch.load(ckpt_path, map_location='cuda')
86
+ model.load_state_dict(ckpt, strict=False)
87
+
88
+ vision_model = VisionModel(model_args)
89
+
90
+ torch.set_default_tensor_type(torch.FloatTensor)
91
+ model.load_state_dict(instruct_adapter_checkpoint, strict=False)
92
+ model.load_state_dict(caption_adapter_checkpoint, strict=False)
93
+ vision_model.load_state_dict(caption_adapter_checkpoint, strict=False)
94
+
95
+ generator = LLaMA(model, tokenizer, vision_model)
96
+ print(f"Loaded in {time.time() - start_time:.2f} seconds")
97
+ return generator
98
+
99
+
100
+ def instruct_generate(
101
+ instruct: str,
102
+ input: str = 'none',
103
+ max_gen_len=512,
104
+ temperature: float = 0.1,
105
+ top_p: float = 0.75,
106
+ ):
107
+ if input == 'none':
108
+ prompt = PROMPT_DICT['prompt_no_input'].format_map(
109
+ {'instruction': instruct, 'input': ''})
110
+ else:
111
+ prompt = PROMPT_DICT['prompt_input'].format_map(
112
+ {'instruction': instruct, 'input': input})
113
+
114
+ results = generator.generate(
115
+ [prompt], max_gen_len=max_gen_len, temperature=temperature, top_p=top_p
116
+ )
117
+ result = results[0].strip()
118
+ # print(result)
119
+ return result
120
+
121
+
122
+ ckpt_path = "/data1/llma/7B/consolidated.00.pth"
123
+ param_path = "/data1/llma/7B/params.json"
124
+ tokenizer_path = "/data1/llma/tokenizer.model"
125
+ instruct_adapter_path = "llama_adapter_len10_layer30_release.pth"
126
+ caption_adapter_path = "llama_adapter_len10_layer30_caption_vit_l.pth"
127
+ max_seq_len = 512
128
+ max_batch_size = 32
129
+
130
+
131
+ local_rank, world_size = setup_model_parallel()
132
+ if local_rank > 0:
133
+ sys.stdout = open(os.devnull, "w")
134
+
135
+ generator = load(
136
+ ckpt_path, param_path, tokenizer_path, instruct_adapter_path, caption_adapter_path, local_rank, world_size, max_seq_len, max_batch_size
137
+ )
138
+
139
+ answer_data = []
140
+ for line in open('question.jsonl').readlines():
141
+ line = json.loads(line)
142
+ question_text = line["text"]
143
+ answer = {
144
+ "answer_id": shortuuid.uuid(),
145
+ "model_id": "LLaMA-Adapter",
146
+ "question_id": line["question_id"],
147
+ "question_text": question_text,
148
+ "text": '',
149
+ "metadata": {}
150
+ }
151
+ answer_data.append(answer)
152
+
153
+ prompts = [PROMPT_DICT['prompt_no_input'].format_map({'instruction': x['question_text']}) for x in answer_data]
154
+
155
+ results = []
156
+ result = generator.generate(prompts[:32], max_gen_len=512, temperature=0.1, top_p=0.75)
157
+ results.extend(result)
158
+ result = generator.generate(prompts[32:64], max_gen_len=512, temperature=0.1, top_p=0.75)
159
+ results.extend(result)
160
+ result = generator.generate(prompts[64:], max_gen_len=512, temperature=0.1, top_p=0.75)
161
+ results.extend(result)
162
+
163
+ for i in range(len(answer_data)):
164
+ answer_i = answer_data[i]
165
+ answer_i['text'] = results[i].strip()
166
+ del answer_i['question_text']
167
+ answer_data[i] = answer_i
168
+
169
+ with open('llama_adapter_7b.json', 'w') as f:
170
+ f.write("\n".join([json.dumps(x) for x in answer_data]))
llama/__init__.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # This software may be used and distributed according to the terms of the GNU General Public License version 3.
3
+
4
+ from .generation import LLaMA
5
+ from .model import ModelArgs, Transformer, VisionModel
6
+ from .tokenizer import Tokenizer
llama/__pycache__/__init__.cpython-38.pyc ADDED
Binary file (322 Bytes). View file
 
llama/__pycache__/generation.cpython-38.pyc ADDED
Binary file (2.84 kB). View file
 
llama/__pycache__/model.cpython-38.pyc ADDED
Binary file (14.2 kB). View file
 
llama/__pycache__/tokenizer.cpython-38.pyc ADDED
Binary file (1.46 kB). View file
 
llama/generation.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # This software may be used and distributed according to the terms of the GNU General Public License version 3.
3
+
4
+ from typing import List
5
+
6
+ import torch
7
+
8
+ from llama.tokenizer import Tokenizer
9
+ from llama.model import Transformer
10
+
11
+
12
+ class LLaMA:
13
+ def __init__(self, model: Transformer, tokenizer: Tokenizer, vision_model = None):
14
+ self.model = model
15
+ self.tokenizer = tokenizer
16
+ self.vision_model = vision_model
17
+
18
+ def generate(
19
+ self,
20
+ prompts: List[str],
21
+ imgs = None,
22
+ max_gen_len: int = 512,
23
+ temperature: float = 0.8,
24
+ top_p: float = 0.95,
25
+ ) -> List[str]:
26
+ bsz = len(prompts)
27
+ params = self.model.params
28
+ assert bsz <= params.max_batch_size, (bsz, params.max_batch_size)
29
+
30
+ mode = 'instruct'
31
+ vision_tokens = None
32
+ if imgs is not None and self.vision_model is not None:
33
+ vision_tokens = self.vision_model(imgs)
34
+ mode = 'caption'
35
+
36
+ prompt_tokens = [self.tokenizer.encode(x, bos=True, eos=False) for x in prompts]
37
+
38
+ min_prompt_size = min([len(t) for t in prompt_tokens])
39
+ max_prompt_size = max([len(t) for t in prompt_tokens])
40
+
41
+ total_len = min(params.max_seq_len, max_gen_len + max_prompt_size)
42
+
43
+ tokens = torch.full((bsz, total_len), self.tokenizer.pad_id).cuda().long()
44
+ for k, t in enumerate(prompt_tokens):
45
+ tokens[k, : len(t)] = torch.tensor(t).long()
46
+ input_text_mask = tokens != self.tokenizer.pad_id
47
+ start_pos = min_prompt_size
48
+ prev_pos = 0
49
+ for cur_pos in range(start_pos, total_len):
50
+ logits = self.model.forward(tokens[:, prev_pos:cur_pos], prev_pos, vision_tokens, mode)
51
+ if temperature > 0:
52
+ probs = torch.softmax(logits / temperature, dim=-1)
53
+ next_token = sample_top_p(probs, top_p)
54
+ else:
55
+ next_token = torch.argmax(logits, dim=-1)
56
+ next_token = next_token.reshape(-1)
57
+ # only replace token if prompt has already been generated
58
+ next_token = torch.where(
59
+ input_text_mask[:, cur_pos], tokens[:, cur_pos], next_token
60
+ )
61
+ tokens[:, cur_pos] = next_token
62
+ prev_pos = cur_pos
63
+
64
+ decoded = []
65
+ for i, t in enumerate(tokens.tolist()):
66
+ # cut to max gen len
67
+ t = t[len(prompt_tokens[i]) : len(prompt_tokens[i]) + max_gen_len]
68
+ # cut to eos tok if any
69
+ try:
70
+ t = t[: t.index(self.tokenizer.eos_id)]
71
+ except ValueError:
72
+ pass
73
+ decoded.append(self.tokenizer.decode(t))
74
+ return decoded
75
+
76
+
77
+ def sample_top_p(probs, p):
78
+ probs_sort, probs_idx = torch.sort(probs, dim=-1, descending=True)
79
+ probs_sum = torch.cumsum(probs_sort, dim=-1)
80
+ mask = probs_sum - probs_sort > p
81
+ probs_sort[mask] = 0.0
82
+ probs_sort.div_(probs_sort.sum(dim=-1, keepdim=True))
83
+ next_token = torch.multinomial(probs_sort, num_samples=1)
84
+ next_token = torch.gather(probs_idx, -1, next_token)
85
+ return next_token
llama/model.py ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # This software may be used and distributed according to the terms of the GNU General Public License version 3.
3
+
4
+ from typing import Optional, Tuple
5
+ from dataclasses import dataclass
6
+ import math
7
+
8
+ import torch
9
+ from torch import nn
10
+ import torch.nn.functional as F
11
+
12
+ import clip
13
+ from timm.models.vision_transformer import Block
14
+
15
+ import fairscale.nn.model_parallel.initialize as fs_init
16
+ from fairscale.nn.model_parallel.layers import (
17
+ ParallelEmbedding,
18
+ RowParallelLinear,
19
+ ColumnParallelLinear,
20
+ )
21
+
22
+ @dataclass
23
+ class ModelArgs:
24
+ dim: int = 512
25
+ n_layers: int = 8
26
+ n_heads: int = 8
27
+ vocab_size: int = -1 # defined later by tokenizer
28
+ multiple_of: int = 256 # make SwiGLU hidden layer size multiple of large power of 2
29
+ norm_eps: float = 1e-5
30
+
31
+ max_batch_size: int = 32
32
+ max_seq_len: int = 2048
33
+
34
+ adapter_len: int = 10
35
+ adapter_layer: int = 30
36
+
37
+ cap_adapter_len: int = 10
38
+ cap_adapter_layer: int = 30
39
+ cap_vision_model: str = "ViT-L/14"
40
+ cap_vision_dim: int = 512
41
+ cap_vision_block: int = 2
42
+
43
+
44
+ class RMSNorm(torch.nn.Module):
45
+ def __init__(self, dim: int, eps: float = 1e-6):
46
+ super().__init__()
47
+ self.eps = eps
48
+ self.weight = nn.Parameter(torch.ones(dim))
49
+
50
+ def _norm(self, x):
51
+ return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)
52
+
53
+ def forward(self, x):
54
+ output = self._norm(x.float()).type_as(x)
55
+ return output * self.weight
56
+
57
+
58
+ def precompute_freqs_cis(dim: int, end: int, theta: float = 10000.0):
59
+ freqs = 1.0 / (theta ** (torch.arange(0, dim, 2)[: (dim // 2)].float() / dim))
60
+ t = torch.arange(end, device=freqs.device) # type: ignore
61
+ freqs = torch.outer(t, freqs).float() # type: ignore
62
+ freqs_cis = torch.polar(torch.ones_like(freqs), freqs) # complex64
63
+ return freqs_cis
64
+
65
+
66
+ def reshape_for_broadcast(freqs_cis: torch.Tensor, x: torch.Tensor):
67
+ ndim = x.ndim
68
+ assert 0 <= 1 < ndim
69
+ assert freqs_cis.shape == (x.shape[1], x.shape[-1])
70
+ shape = [d if i == 1 or i == ndim - 1 else 1 for i, d in enumerate(x.shape)]
71
+ return freqs_cis.view(*shape)
72
+
73
+
74
+ def apply_rotary_emb(
75
+ xq: torch.Tensor,
76
+ xk: torch.Tensor,
77
+ freqs_cis: torch.Tensor,
78
+ ) -> Tuple[torch.Tensor, torch.Tensor]:
79
+ xq_ = torch.view_as_complex(xq.float().reshape(*xq.shape[:-1], -1, 2))
80
+ xk_ = torch.view_as_complex(xk.float().reshape(*xk.shape[:-1], -1, 2))
81
+ freqs_cis = reshape_for_broadcast(freqs_cis, xq_)
82
+ xq_out = torch.view_as_real(xq_ * freqs_cis).flatten(3)
83
+ xk_out = torch.view_as_real(xk_ * freqs_cis).flatten(3)
84
+ return xq_out.type_as(xq), xk_out.type_as(xk)
85
+
86
+
87
+ class Attention(nn.Module):
88
+ def __init__(self, args: ModelArgs):
89
+ super().__init__()
90
+
91
+ self.n_local_heads = args.n_heads // fs_init.get_model_parallel_world_size()
92
+ self.head_dim = args.dim // args.n_heads
93
+
94
+ self.wq = ColumnParallelLinear(
95
+ args.dim,
96
+ args.n_heads * self.head_dim,
97
+ bias=False,
98
+ gather_output=False,
99
+ init_method=lambda x: x,
100
+ )
101
+ self.wk = ColumnParallelLinear(
102
+ args.dim,
103
+ args.n_heads * self.head_dim,
104
+ bias=False,
105
+ gather_output=False,
106
+ init_method=lambda x: x,
107
+ )
108
+ self.wv = ColumnParallelLinear(
109
+ args.dim,
110
+ args.n_heads * self.head_dim,
111
+ bias=False,
112
+ gather_output=False,
113
+ init_method=lambda x: x,
114
+ )
115
+ self.wo = RowParallelLinear(
116
+ args.n_heads * self.head_dim,
117
+ args.dim,
118
+ bias=False,
119
+ input_is_parallel=True,
120
+ init_method=lambda x: x,
121
+ )
122
+
123
+ self.cache_k = torch.zeros(
124
+ (args.max_batch_size, args.max_seq_len, self.n_local_heads, self.head_dim)
125
+ ).cuda()
126
+ self.cache_v = torch.zeros(
127
+ (args.max_batch_size, args.max_seq_len, self.n_local_heads, self.head_dim)
128
+ ).cuda()
129
+ self.gate = torch.nn.Parameter(torch.zeros(1))
130
+
131
+ self.cap_gate = torch.nn.Parameter(torch.zeros(1, self.n_local_heads, 1, 1))
132
+
133
+
134
+ def forward(self, x: torch.Tensor, start_pos: int, freqs_cis: torch.Tensor, mask: Optional[torch.Tensor], adapter=None, mode='instruct'):
135
+ if mode == 'instruct':
136
+ return self.forward_instruct(x, start_pos, freqs_cis, mask, adapter)
137
+ elif mode == 'caption':
138
+ return self.forward_caption(x, start_pos, freqs_cis, mask, adapter)
139
+
140
+
141
+ def forward_instruct(self, x: torch.Tensor, start_pos: int, freqs_cis: torch.Tensor, mask: Optional[torch.Tensor], adapter=None):
142
+ bsz, seqlen, _ = x.shape
143
+ xq, xk, xv = self.wq(x), self.wk(x), self.wv(x)
144
+
145
+ xq = xq.view(bsz, seqlen, self.n_local_heads, self.head_dim)
146
+ xk = xk.view(bsz, seqlen, self.n_local_heads, self.head_dim)
147
+ xv = xv.view(bsz, seqlen, self.n_local_heads, self.head_dim)
148
+
149
+ xq, xk = apply_rotary_emb(xq, xk, freqs_cis=freqs_cis)
150
+
151
+ self.cache_k = self.cache_k.to(xq)
152
+ self.cache_v = self.cache_v.to(xq)
153
+
154
+ self.cache_k[:bsz, start_pos : start_pos + seqlen] = xk
155
+ self.cache_v[:bsz, start_pos : start_pos + seqlen] = xv
156
+
157
+ keys = self.cache_k[:bsz, : start_pos + seqlen]
158
+ values = self.cache_v[:bsz, : start_pos + seqlen]
159
+
160
+ if adapter is not None:
161
+ adapter_len = adapter.shape[1]
162
+ adapter_k = self.wk(adapter).view(1, adapter_len, self.n_local_heads, self.head_dim).repeat(bsz, 1, 1, 1)
163
+ adapter_v = self.wv(adapter).view(1, adapter_len, self.n_local_heads, self.head_dim).repeat(bsz, 1, 1, 1)
164
+ adapter_k = adapter_k.transpose(1, 2)
165
+ adapter_v = adapter_v.transpose(1, 2)
166
+ xq = xq.transpose(1, 2)
167
+ keys = keys.transpose(1, 2)
168
+ values = values.transpose(1, 2)
169
+ scores = torch.matmul(xq, keys.transpose(2, 3)) / math.sqrt(self.head_dim)
170
+ if mask is not None:
171
+ scores = scores + mask # (bs, n_local_heads, slen, cache_len + slen)
172
+ scores = F.softmax(scores.float(), dim=-1).type_as(xq)
173
+ output = torch.matmul(scores, values) # (bs, n_local_heads, slen, head_dim)
174
+ if adapter is not None:
175
+ adapter_scores = torch.matmul(xq, adapter_k.transpose(2, 3)) / math.sqrt(self.head_dim)
176
+ adapter_scores = self.gate * F.softmax(adapter_scores.float(), dim=-1).type_as(xq)
177
+ output = output + torch.matmul(adapter_scores, adapter_v)
178
+ output = output.transpose(
179
+ 1, 2
180
+ ).contiguous().view(bsz, seqlen, -1)
181
+
182
+ return self.wo(output)
183
+
184
+
185
+ def forward_caption(self, x: torch.Tensor, start_pos: int, freqs_cis: torch.Tensor, mask: Optional[torch.Tensor], adapter=None):
186
+ bsz, seqlen, _ = x.shape
187
+ xq, xk, xv = self.wq(x), self.wk(x), self.wv(x)
188
+
189
+ xq = xq.view(bsz, seqlen, self.n_local_heads, self.head_dim)
190
+ xk = xk.view(bsz, seqlen, self.n_local_heads, self.head_dim)
191
+ xv = xv.view(bsz, seqlen, self.n_local_heads, self.head_dim)
192
+
193
+ xq, xk = apply_rotary_emb(xq, xk, freqs_cis=freqs_cis)
194
+
195
+ self.cache_k = self.cache_k.to(xq)
196
+ self.cache_v = self.cache_v.to(xq)
197
+
198
+ self.cache_k[:bsz, start_pos : start_pos + seqlen] = xk
199
+ self.cache_v[:bsz, start_pos : start_pos + seqlen] = xv
200
+
201
+ keys = self.cache_k[:bsz, : start_pos + seqlen]
202
+ values = self.cache_v[:bsz, : start_pos + seqlen]
203
+
204
+ if adapter is not None:
205
+ adapter_len = adapter.shape[1]
206
+ adapter_k = self.wk(adapter).view(bsz, adapter_len, self.n_local_heads, self.head_dim)
207
+ adapter_v = self.wv(adapter).view(bsz, adapter_len, self.n_local_heads, self.head_dim)
208
+ adapter_k = adapter_k.transpose(1, 2)
209
+ adapter_v = adapter_v.transpose(1, 2)
210
+ xq = xq.transpose(1, 2)
211
+ keys = keys.transpose(1, 2)
212
+ values = values.transpose(1, 2)
213
+ scores = torch.matmul(xq, keys.transpose(2, 3)) / math.sqrt(self.head_dim)
214
+ if mask is not None:
215
+ scores = scores + mask # (bs, n_local_heads, slen, cache_len + slen)
216
+ scores = F.softmax(scores.float(), dim=-1).type_as(xq)
217
+ output = torch.matmul(scores, values) # (bs, n_local_heads, slen, head_dim)
218
+ if adapter is not None:
219
+ adapter_scores = torch.matmul(xq, adapter_k.transpose(2, 3)) / math.sqrt(self.head_dim)
220
+ adapter_scores = self.cap_gate.tanh() * F.softmax(adapter_scores.float(), dim=-1).type_as(xq)
221
+
222
+ output = output + torch.matmul(adapter_scores, adapter_v)
223
+ output = output.transpose(
224
+ 1, 2
225
+ ).contiguous().view(bsz, seqlen, -1)
226
+
227
+ return self.wo(output)
228
+
229
+
230
+
231
+ class FeedForward(nn.Module):
232
+ def __init__(
233
+ self,
234
+ dim: int,
235
+ hidden_dim: int,
236
+ multiple_of: int,
237
+ ):
238
+ super().__init__()
239
+ hidden_dim = int(2 * hidden_dim / 3)
240
+ hidden_dim = multiple_of * ((hidden_dim + multiple_of - 1) // multiple_of)
241
+
242
+ self.w1 = ColumnParallelLinear(
243
+ dim, hidden_dim, bias=False, gather_output=False, init_method=lambda x: x
244
+ )
245
+ self.w2 = RowParallelLinear(
246
+ hidden_dim, dim, bias=False, input_is_parallel=True, init_method=lambda x: x
247
+ )
248
+ self.w3 = ColumnParallelLinear(
249
+ dim, hidden_dim, bias=False, gather_output=False, init_method=lambda x: x
250
+ )
251
+
252
+ def forward(self, x):
253
+ return self.w2(F.silu(self.w1(x)) * self.w3(x))
254
+
255
+
256
+ class TransformerBlock(nn.Module):
257
+ def __init__(self, layer_id: int, args: ModelArgs):
258
+ super().__init__()
259
+ self.n_heads = args.n_heads
260
+ self.dim = args.dim
261
+ self.head_dim = args.dim // args.n_heads
262
+ self.attention = Attention(args)
263
+ self.feed_forward = FeedForward(
264
+ dim=args.dim, hidden_dim=4 * args.dim, multiple_of=args.multiple_of
265
+ )
266
+ self.layer_id = layer_id
267
+ self.attention_norm = RMSNorm(args.dim, eps=args.norm_eps)
268
+ self.ffn_norm = RMSNorm(args.dim, eps=args.norm_eps)
269
+
270
+ def forward(self, x: torch.Tensor, start_pos: int, freqs_cis: torch.Tensor, mask: Optional[torch.Tensor], adapter=None, mode='instruct'):
271
+ h = x + self.attention.forward(self.attention_norm(x), start_pos, freqs_cis, mask, adapter, mode=mode)
272
+ out = h + self.feed_forward.forward(self.ffn_norm(h))
273
+ return out
274
+
275
+
276
+ class Transformer(nn.Module):
277
+ def __init__(self, params: ModelArgs):
278
+ super().__init__()
279
+ self.params = params
280
+ self.vocab_size = params.vocab_size
281
+ self.n_layers = params.n_layers
282
+
283
+ self.tok_embeddings = ParallelEmbedding(
284
+ params.vocab_size, params.dim, init_method=lambda x: x
285
+ )
286
+
287
+ self.layers = torch.nn.ModuleList()
288
+ for layer_id in range(params.n_layers):
289
+ self.layers.append(TransformerBlock(layer_id, params))
290
+
291
+ self.norm = RMSNorm(params.dim, eps=params.norm_eps)
292
+ self.output = ColumnParallelLinear(
293
+ params.dim, params.vocab_size, bias=False, init_method=lambda x: x
294
+ )
295
+
296
+ self.freqs_cis = precompute_freqs_cis(
297
+ self.params.dim // self.params.n_heads, self.params.max_seq_len * 2
298
+ )
299
+
300
+ # Note: this is only a preview of multimodal LLaMA-Adapter
301
+ # and requires more efforts to decouple LLaMA-Adapter from LLaMA.
302
+ # instruct model
303
+ self.adapter_query = nn.Embedding(params.adapter_len * params.adapter_layer, params.dim)
304
+ self.adapter_len = params.adapter_len
305
+ self.adapter_layer = params.adapter_layer
306
+
307
+ # caption model
308
+ self.cap_adapter_query = nn.Embedding(params.cap_adapter_len * params.cap_adapter_layer, params.dim)
309
+ self.cap_adapter_len = params.cap_adapter_len
310
+ self.cap_adapter_layer = params.cap_adapter_layer
311
+
312
+ @torch.inference_mode()
313
+ def forward(self, tokens: torch.Tensor, start_pos: int, visual_tokens: torch.Tensor = None, mode: str = 'instruct'):
314
+ if mode == 'instruct':
315
+ return self.forward_instruct(tokens, start_pos, mode)
316
+ elif mode == 'caption':
317
+ return self.forward_caption(tokens, start_pos, visual_tokens, mode)
318
+
319
+ def forward_instruct(self, tokens: torch.Tensor, start_pos: int, mode=None):
320
+ _bsz, seqlen = tokens.shape
321
+ h = self.tok_embeddings(tokens)
322
+ self.freqs_cis = self.freqs_cis.to(h.device)
323
+ freqs_cis = self.freqs_cis[start_pos : start_pos + seqlen]
324
+ adapter = self.adapter_query.weight.reshape(self.params.adapter_layer, self.params.adapter_len, self.params.dim).unsqueeze(1)
325
+ mask = None
326
+ if seqlen > 1:
327
+ mask = torch.full((1, 1, seqlen, seqlen), float("-inf"), device=tokens.device)
328
+ mask = torch.triu(mask, diagonal=start_pos + 1).type_as(h)
329
+
330
+ for layer in self.layers[: -1 * self.params.adapter_layer]:
331
+ h = layer(h, start_pos, freqs_cis, mask)
332
+ layer_index = 0
333
+ for layer in self.layers[-1 * self.params.adapter_layer:]:
334
+ h = layer(h, start_pos, freqs_cis, mask, adapter[layer_index], mode=mode)
335
+ layer_index = layer_index + 1
336
+ h = self.norm(h)
337
+ output = self.output(h[:, -1, :]) # only compute last logits
338
+ return output.float()
339
+
340
+ def forward_caption(self, tokens: torch.Tensor, start_pos: int, visual_tokens: torch.Tensor = None, mode=None):
341
+ _bsz, seqlen = tokens.shape
342
+ h = self.tok_embeddings(tokens)
343
+ self.freqs_cis = self.freqs_cis.to(h.device)
344
+ freqs_cis = self.freqs_cis[start_pos : start_pos + seqlen]
345
+ adapter = self.cap_adapter_query.weight.reshape(self.params.cap_adapter_layer, self.params.cap_adapter_len, self.params.dim).unsqueeze(1)
346
+ mask = None
347
+ if seqlen > 1:
348
+ mask = torch.full((1, 1, seqlen, seqlen), float("-inf"), device=tokens.device)
349
+ mask = torch.triu(mask, diagonal=start_pos + 1).type_as(h)
350
+
351
+ for layer in self.layers[: -1 * self.params.cap_adapter_layer]:
352
+ h = layer(h, start_pos, freqs_cis, mask)
353
+ layer_index = 0
354
+ for layer in self.layers[-1 * self.params.cap_adapter_layer:]:
355
+ adapter_per_layer = adapter[layer_index]
356
+ if visual_tokens is not None:
357
+ adapter_per_layer = adapter_per_layer + visual_tokens
358
+ h = layer(h, start_pos, freqs_cis, mask, adapter_per_layer, mode=mode)
359
+ layer_index = layer_index + 1
360
+ h = self.norm(h)
361
+ output = self.output(h[:, -1, :]) # only compute last logits
362
+ return output.float()
363
+
364
+
365
+
366
+ class VisionModel(nn.Module):
367
+ def __init__(self, params: ModelArgs):
368
+ super().__init__()
369
+
370
+ self.params = params
371
+
372
+ self.clip, self.clip_transform = clip.load(params.cap_vision_model)
373
+ self.clip.float()
374
+ for param in self.clip.parameters():
375
+ param.requires_grad = False
376
+
377
+ self.clip_proj = nn.Linear(self.clip.visual.output_dim, params.cap_vision_dim)
378
+ self.clip_proj_norm = nn.LayerNorm(params.cap_vision_dim)
379
+
380
+ self.visual_query = nn.Embedding(params.cap_adapter_len, params.cap_vision_dim)
381
+
382
+ self.visual_blocks = nn.ModuleList([
383
+ Block(params.cap_vision_dim, 16, 4, qkv_bias=True, qk_scale=None, norm_layer=nn.LayerNorm)
384
+ for i in range(params.cap_vision_block)])
385
+
386
+ self.visual_proj = nn.Linear(params.cap_vision_dim, params.dim)
387
+ self.visual_proj_norm = nn.LayerNorm(params.dim)
388
+
389
+ def clip_encode_image(self, x):
390
+ x = self.clip.visual.conv1(x) # shape = [*, width, grid, grid]
391
+ x = x.reshape(x.shape[0], x.shape[1], -1) # shape = [*, width, grid ** 2]
392
+ x = x.permute(0, 2, 1) # shape = [*, grid ** 2, width]
393
+ x = torch.cat([self.clip.visual.class_embedding.to(x.dtype) + torch.zeros(x.shape[0], 1, x.shape[-1], dtype=x.dtype, device=x.device), x], dim=1) # shape = [*, grid ** 2 + 1, width]
394
+ x = x + self.clip.visual.positional_embedding.to(x.dtype)
395
+ x = self.clip.visual.ln_pre(x)
396
+
397
+ x = x.permute(1, 0, 2) # NLD -> LND
398
+ x = self.clip.visual.transformer(x)
399
+ x = x.permute(1, 0, 2) # LND -> NLD
400
+
401
+ x = self.clip.visual.ln_post(x[:, :, :])
402
+
403
+ if self.clip.visual.proj is not None:
404
+ x = x @ self.clip.visual.proj
405
+
406
+ return x
407
+
408
+ def forward(self, imgs):
409
+ x = [self.clip_transform(img) for img in imgs]
410
+ x = torch.stack(x, dim=0).to(self.visual_query.weight.device)
411
+ _bsz = x.shape[0]
412
+
413
+ visual_feats = self.clip_encode_image(x).half()
414
+ visual_feats = self.clip_proj_norm(self.clip_proj(visual_feats))
415
+ visual_query = self.visual_query.weight.unsqueeze(0).repeat(_bsz, 1, 1)
416
+ visual_query = torch.cat([visual_query, visual_feats], dim=1)
417
+ for block in self.visual_blocks:
418
+ visual_query = block(visual_query)
419
+ visual_query = visual_query[:, :self.params.cap_adapter_len, :]
420
+ visual_query = self.visual_proj(visual_query)
421
+ visual_query = self.visual_proj_norm(visual_query)
422
+
423
+ return visual_query
llama/tokenizer.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # This software may be used and distributed according to the terms of the GNU General Public License version 3.
3
+
4
+ from sentencepiece import SentencePieceProcessor
5
+ from logging import getLogger
6
+ from typing import List
7
+ import os
8
+
9
+
10
+ logger = getLogger()
11
+
12
+
13
+ class Tokenizer:
14
+ def __init__(self, model_path: str):
15
+ # reload tokenizer
16
+ assert os.path.isfile(model_path), model_path
17
+ self.sp_model = SentencePieceProcessor(model_file=model_path)
18
+ logger.info(f"Reloaded SentencePiece model from {model_path}")
19
+
20
+ # BOS / EOS token IDs
21
+ self.n_words: int = self.sp_model.vocab_size()
22
+ self.bos_id: int = self.sp_model.bos_id()
23
+ self.eos_id: int = self.sp_model.eos_id()
24
+ self.pad_id: int = self.sp_model.pad_id()
25
+ logger.info(
26
+ f"#words: {self.n_words} - BOS ID: {self.bos_id} - EOS ID: {self.eos_id}"
27
+ )
28
+ assert self.sp_model.vocab_size() == self.sp_model.get_piece_size()
29
+
30
+ def encode(self, s: str, bos: bool, eos: bool) -> List[int]:
31
+ assert type(s) is str
32
+ t = self.sp_model.encode(s)
33
+ if bos:
34
+ t = [self.bos_id] + t
35
+ if eos:
36
+ t = t + [self.eos_id]
37
+ return t
38
+
39
+ def decode(self, t: List[int]) -> str:
40
+ return self.sp_model.decode(t)
llama_adapter_7b.json ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"answer_id": "k8CJvsJqhNegghJ8hZddrq", "model_id": "LLaMA-Adapter", "question_id": 1, "text": "One way to improve your time management skills is to create a schedule and stick to it. Set aside time for each task and make sure to prioritize the most important tasks first. Also, try to be realistic about how much time each task will take and plan accordingly. Additionally, it is important to be organized and stay focused on the task at hand.", "metadata": {}}
2
+ {"answer_id": "jkkkLos34gEAMG4aa8yXv4", "model_id": "LLaMA-Adapter", "question_id": 2, "text": "The most effective ways to deal with stress are to practice mindfulness, exercise regularly, get enough sleep, eat a healthy diet, and seek professional help if needed.", "metadata": {}}
3
+ {"answer_id": "Q5Twjv7SzVxbo9m4T7WGYp", "model_id": "LLaMA-Adapter", "question_id": 3, "text": "The main differences between Python and JavaScript programming languages are the syntax, the type of data they can handle, and the level of abstraction. Python is a high-level programming language that uses indentation to control flow and is more structured than JavaScript. JavaScript is a low-level programming language that uses curly brackets to control flow and is more dynamic than Python. Python can handle both object-oriented and functional programming, while JavaScript is only object-oriented. Python is more abstract and can handle more complex data structures, while JavaScript is more focused on the web.", "metadata": {}}
4
+ {"answer_id": "7qrPBnHrttMRyrD9srfdb7", "model_id": "LLaMA-Adapter", "question_id": 4, "text": "Increasing productivity while working from home can be achieved by setting clear goals, creating a workspace that is conducive to productivity, and establishing a routine. Setting clear goals will help you stay focused and motivated, while creating a workspace that is free of distractions will help you stay on task. Establishing a routine will help you stay organized and on track, and will help you avoid procrastination. Additionally, taking breaks throughout the day will help you stay refreshed and focused.", "metadata": {}}
5
+ {"answer_id": "CkxFkhCroupdHugmME78C4", "model_id": "LLaMA-Adapter", "question_id": 5, "text": "Quantum computing is a type of computing that uses quantum-mechanical phenomena, such as superposition and entanglement, to solve certain problems more efficiently than traditional computers. Quantum computers are able to process information in a way that traditional computers cannot, allowing them to solve certain problems that are intractable for traditional computers. Quantum computers are also able to process information in parallel, allowing them to solve problems much faster than traditional computers.", "metadata": {}}
6
+ {"answer_id": "YzzRABrTxrGeMngkfqTXuw", "model_id": "LLaMA-Adapter", "question_id": 6, "text": "The main differences between plant-based and animal-based protein sources are the sources of the protein and the nutritional content. Plant-based protein sources are typically derived from legumes, nuts, seeds, and grains, while animal-based protein sources are typically derived from meat, fish, and dairy products. Plant-based protein sources are typically higher in fiber, vitamins, and minerals, while animal-based protein sources are typically higher in protein and fat.", "metadata": {}}
7
+ {"answer_id": "WbtZ3FHmX6ft4w4jP6TYGu", "model_id": "LLaMA-Adapter", "question_id": 7, "text": "Developing critical thinking skills involves a variety of activities, such as reading, writing, and discussing topics with others. Reading widely and critically, writing about what you read, and engaging in discussions with others can all help to develop your critical thinking skills. Additionally, you can practice asking questions, analyzing arguments, and evaluating evidence.", "metadata": {}}
8
+ {"answer_id": "VBJHe43g5qtVaKK4dYs3Fh", "model_id": "LLaMA-Adapter", "question_id": 8, "text": "The major challenges faced by the education sector today include a lack of access to quality education, a lack of resources and funding, a lack of qualified teachers, and a lack of technology and innovation.", "metadata": {}}
9
+ {"answer_id": "hGr68spRMR2Zk8UJkY8LbZ", "model_id": "LLaMA-Adapter", "question_id": 9, "text": "The primary factors that influence consumer behavior are the consumer's demographics, psychographics, and the environment in which they live. Demographics include factors such as age, gender, income, education, and occupation. Psychographics include factors such as personality, values, attitudes, and lifestyle. The environment includes factors such as the economy, technology, and culture.", "metadata": {}}
10
+ {"answer_id": "nhViBfWsud39nVRWTcncMr", "model_id": "LLaMA-Adapter", "question_id": 10, "text": "The most effective strategies for conflict resolution in the workplace include active listening, empathy, and open communication. Active listening involves listening to the other person's perspective and understanding their point of view. Empathy involves understanding the other person's emotions and feelings. Open communication involves expressing your own thoughts and feelings in a respectful and constructive manner.", "metadata": {}}
11
+ {"answer_id": "BvPHafeibxd4SVcUqtUoks", "model_id": "LLaMA-Adapter", "question_id": 11, "text": "Using a single-use plastic bottle instead of a reusable bottle has several potential implications on the environment and human health. First, single-use plastic bottles are made from non-renewable resources, which means they are not sustainable. Additionally, single-use plastic bottles are often not recycled, which means they end up in landfills and oceans, where they can take hundreds of years to break down. This can lead to pollution and contamination of the environment. Additionally, single-use plastic bottles can contain chemicals that can leach into the water, which can be harmful to human health. On the other hand, reusable bottles are made from renewable resources and can be recycled, which means they are more sustainable. Additionally, reusable bottles can be washed and reused, which means they are more environmentally friendly. Finally, reusable bottles do not contain any chemicals that can leach into the water, which means they are safer for human health.", "metadata": {}}
12
+ {"answer_id": "HN8QyZgRVuDDADoRKXEiiH", "model_id": "LLaMA-Adapter", "question_id": 12, "text": "When designing an inclusive and accessible public transportation system, it is important to consider factors such as accessibility of stations, accessibility of vehicles, accessibility of routes, accessibility of ticketing systems, accessibility of information and communication systems, and accessibility of customer service.", "metadata": {}}
13
+ {"answer_id": "GW3VtnCgj7SgLhp9ddAYyM", "model_id": "LLaMA-Adapter", "question_id": 13, "text": "Governments can utilize fiscal and monetary policies to combat economic recessions by stimulating the economy through tax cuts and increased government spending, as well as by lowering interest rates to encourage borrowing and investment. Additionally, governments can implement policies to encourage businesses to hire more workers and invest in new projects, as well as to encourage consumers to spend more.", "metadata": {}}
14
+ {"answer_id": "DiUdnt8XpuVc58ZSSWaeSc", "model_id": "LLaMA-Adapter", "question_id": 14, "text": "Language and cultural barriers can have a significant impact on the way people communicate and form relationships in multicultural societies. Language barriers can make it difficult to understand each other, leading to miscommunication and misunderstandings. Cultural barriers can also make it difficult to understand each other, as different cultures have different values and beliefs. This can lead to conflict and misunderstandings, as people from different cultures may not understand each other's perspectives.", "metadata": {}}
15
+ {"answer_id": "kcRzZt5iMVKvGeEDPnECm7", "model_id": "LLaMA-Adapter", "question_id": 15, "text": "Artificial intelligence could be used to improve the quality and efficiency of healthcare delivery by automating tasks such as diagnosis, treatment planning, and prescription writing. AI could also be used to analyze patient data and identify patterns that could help doctors make more informed decisions. Additionally, AI could be used to provide personalized care by tailoring treatments to each patient's unique needs.", "metadata": {}}
16
+ {"answer_id": "D75aoB4zdr7JWdPr4oYkM7", "model_id": "LLaMA-Adapter", "question_id": 16, "text": "Gene editing using CRISPR-Cas9 technology involves the use of a pair of enzymes, Cas9 and guide RNA, to cut and paste DNA sequences. The guide RNA is designed to target a specific sequence of DNA, and the Cas9 enzyme cuts the DNA at the targeted sequence. The DNA is then repaired by the cell\u2019s own repair mechanisms, resulting in a desired change in the DNA sequence. This technology has the potential to be used for a variety of applications, such as treating genetic diseases, creating new medicines, and improving agricultural yields. However, there are also ethical implications associated with gene editing, such as the potential for unintended consequences and the possibility of creating designer babies.", "metadata": {}}
17
+ {"answer_id": "fmdHa76ofNMmTn7fMqPoFj", "model_id": "LLaMA-Adapter", "question_id": 17, "text": "Vaccinations work by introducing a small amount of a weakened or dead version of a disease-causing virus or bacteria into the body. This stimulates the immune system to produce antibodies that recognize and neutralize the pathogen. Vaccinations also help to protect the community by creating a layer of protection known as herd immunity. This is when a large percentage of the population is vaccinated, which prevents the spread of disease.", "metadata": {}}
18
+ {"answer_id": "4c8SZeSEmQaG8nnn2nx6Rs", "model_id": "LLaMA-Adapter", "question_id": 18, "text": "Social media platforms have had a significant influence on the way people consume and share news. They have enabled people to access a wide range of news sources and to share news with a large audience in a short amount of time. This has led to the spread of misinformation, as people are often not able to verify the accuracy of the information they are sharing. Additionally, the algorithms used by social media platforms can lead to the amplification of certain types of content, which can further exacerbate the spread of misinformation.", "metadata": {}}
19
+ {"answer_id": "ceP3rvLdsvPUdkscVmfjj9", "model_id": "LLaMA-Adapter", "question_id": 19, "text": "Cultural, social, and economic factors can influence people's food choices in a variety of ways. For example, cultural factors such as religion, ethnicity, and gender can influence food choices. Social factors such as access to food, education, and income can also influence food choices. Economic factors such as cost, availability, and convenience can also influence food choices.\n\nKnowledge of these factors can be used to promote healthier diets. For example, cultural factors such as religion and ethnicity can be used to promote healthier diets by providing access to healthy foods that are traditionally associated with a particular culture. Social factors such as education and income can be used to promote healthier diets by providing access to healthy foods that are more affordable and convenient. Economic factors such as cost, availability, and convenience can be used to promote healthier diets by providing access to healthy foods that are more affordable and convenient.", "metadata": {}}
20
+ {"answer_id": "BnHtZ5NNsC8PPdGQA4bY2N", "model_id": "LLaMA-Adapter", "question_id": 20, "text": "Natural selection is the process by which organisms with certain traits are more likely to survive and reproduce than those with other traits. This process is driven by the environment, which determines which traits are advantageous and which are not. Over time, organisms with advantageous traits will be more likely to survive and reproduce, while those with disadvantageous traits will be less likely to survive and reproduce. This process of natural selection leads to the evolution and adaptation of species.", "metadata": {}}
21
+ {"answer_id": "HHKDxB28EvRcn9AtLqPqYR", "model_id": "LLaMA-Adapter", "question_id": 21, "text": "My name is Sir John of the House of Smith, and I am honored to be here at the royal banquet. I am a loyal and brave knight, and I have served the kingdom faithfully for many years. I am here to show my respect and appreciation for the king and his court.", "metadata": {}}
22
+ {"answer_id": "Ku6ptUuLSNkzoyMTxRQE8Z", "model_id": "LLaMA-Adapter", "question_id": 22, "text": "My crew, we have a great opportunity before us! We have the chance to find hidden treasure and make our fortunes! Let's work together and use our skills to find the treasure and make our dreams come true!", "metadata": {}}
23
+ {"answer_id": "LcoKnZTeLWSUVYMEG5JsMn", "model_id": "LLaMA-Adapter", "question_id": 23, "text": "I would declare my love for someone in a soliloquy by saying, \"I love thee with the breath, smiles, tears of mine, and if those treasures of my heart I count but a part of my true love, I cannot express the depth of my passion for thee.\"", "metadata": {}}
24
+ {"answer_id": "hAQYRuKPr7gY7FVVZYgypz", "model_id": "LLaMA-Adapter", "question_id": 24, "text": "I was born with special powers that I use to help people in need. I use my powers to protect the innocent and fight evil. I am always ready to answer the call of justice and help those in need.", "metadata": {}}
25
+ {"answer_id": "Bn62zcJdPgs2thBgELWArq", "model_id": "LLaMA-Adapter", "question_id": 25, "text": "I would tell people about the advancements in artificial intelligence, robotics, and virtual reality. I would also tell them about the advancements in medicine, such as gene therapy and regenerative medicine. I would also tell them about the advancements in energy production, such as solar and wind power, as well as the advancements in transportation, such as self-driving cars and space travel.", "metadata": {}}
26
+ {"answer_id": "BJ5W5Uk8GYyeFQKTDi3FnV", "model_id": "LLaMA-Adapter", "question_id": 26, "text": "With just seconds remaining in the game, the team's star player made a brilliant move, dribbling past the defense and finding an open teammate for the game-winning shot. The crowd erupted in cheers as the buzzer sounded, and the team was crowned the champions.", "metadata": {}}
27
+ {"answer_id": "UzQhdwKcVNNBa4hZA9ogY4", "model_id": "LLaMA-Adapter", "question_id": 27, "text": "My signature dish is a delicious and mouth-watering combination of fresh ingredients, carefully selected to create a unique and memorable flavor. It is a dish that is sure to impress any palate, and is sure to leave a lasting impression on the judges.", "metadata": {}}
28
+ {"answer_id": "WinokawAJkMisEX4YKFrxt", "model_id": "LLaMA-Adapter", "question_id": 28, "text": "I felt an overwhelming sense of accomplishment as I reached the summit of Mount Everest. The view from the top was breathtaking, with the vast expanse of the Himalayas stretching out before me. I was filled with a sense of awe and gratitude for the opportunity to experience such a magnificent sight.", "metadata": {}}
29
+ {"answer_id": "kXrw9rxDjqP4UsJbPdSxVP", "model_id": "LLaMA-Adapter", "question_id": 29, "text": "As a space colonist on Mars, my daily life is filled with challenges and adventure. I wake up to the sound of the Martian winds and the sunrise over the red planet. I take a walk around the colony and enjoy the beautiful views of the Martian landscape. I then head to work, where I help to maintain the colony and explore the planet. After work, I enjoy the Martian sunset and relax with my friends. I also take part in various activities such as hiking, rock climbing, and exploring the Martian caves. I also enjoy the Martian night sky and the stars that light up the sky.", "metadata": {}}
30
+ {"answer_id": "Kp8ev3mFzpRYMrnHGHC589", "model_id": "LLaMA-Adapter", "question_id": 30, "text": "I am a young woman living in a post-apocalyptic world. I have been forced to survive on my own for years, but I have managed to find a few allies along the way. I have learned to hunt and forage for food, and I have learned to make do with what little resources I have. I have also learned to be resourceful and creative in order to survive. I have found a few other survivors who have become my allies, and together we have managed to find a way to make it through.", "metadata": {}}
31
+ {"answer_id": "gxTAv4KFJWW6im8MsLLkJN", "model_id": "LLaMA-Adapter", "question_id": 31, "text": "You can determine if a restaurant is popular among locals or mainly attracts tourists by looking at the menu and prices. If the menu is full of local dishes and the prices are reasonable, it is likely that the restaurant is popular among locals. On the other hand, if the menu is full of tourist-friendly dishes and the prices are higher, it is likely that the restaurant is mainly attracting tourists. This information is useful because it can help you decide if the restaurant is worth visiting.", "metadata": {}}
32
+ {"answer_id": "RxMm4UecAFduyehoNJBqD9", "model_id": "LLaMA-Adapter", "question_id": 32, "text": "Some subtle clues that suggest someone is pretending to understand a topic or conversation when they are actually confused or uninformed include: \n- Making vague or general statements \n- Using jargon or technical terms \n- Asking questions that are easily answered with a quick internet search \n- Using words or phrases that are not commonly used in the conversation \n- Using words or phrases that are not relevant to the topic \n- Using words or phrases that are not commonly used in the conversation \n- Using words or phrases that are not relevant to the topic", "metadata": {}}
33
+ {"answer_id": "GzfrMcbRftsFPZPH96kAcs", "model_id": "LLaMA-Adapter", "question_id": 33, "text": "Some people prefer to use a paper map or ask for directions instead of relying on a GPS device or smartphone app because it allows them to explore their surroundings and get a better sense of the area. Additionally, paper maps and asking for directions can be more reliable than a GPS device or smartphone app, as they are less likely to be affected by signal interference or other issues.", "metadata": {}}
34
+ {"answer_id": "8L2amtbnM5Vi6N8FomMpGf", "model_id": "LLaMA-Adapter", "question_id": 34, "text": "There are a few signs that can help you determine if a person is genuinely interested in a conversation or simply being polite. These signs include eye contact, body language, and the amount of time they spend listening to you. If a person is making eye contact, leaning in, and asking questions, they are likely interested in the conversation. If they are looking away, fidgeting, and not asking questions, they are likely just being polite.", "metadata": {}}
35
+ {"answer_id": "bF3bHA4DiFcVRzpQD68PLG", "model_id": "LLaMA-Adapter", "question_id": 35, "text": "Some people prefer to shop at a small, locally-owned business instead of a large chain store, even if the prices are higher, because they value the personalized service and the unique products that the small business offers. Additionally, they may prefer to support a local business that is owned by their neighbors and helps to support the local economy.", "metadata": {}}
36
+ {"answer_id": "3sdbRdLhyssdjTZpxf3d4q", "model_id": "LLaMA-Adapter", "question_id": 36, "text": "There are several ways to assess the credibility of a source of information, such as a news article or blog post. One way is to look at the author's credentials and experience. Another is to look at the source of the information, such as the publisher or website. Additionally, you can look at the content of the article, such as the sources used and the language used. Finally, you can look at the comments section to see if other readers have any feedback or concerns.", "metadata": {}}
37
+ {"answer_id": "Bxwvvo2gLKYn9zsq5TDshQ", "model_id": "LLaMA-Adapter", "question_id": 37, "text": "Some people enjoy the sensation of being scared because it can provide a thrill and a sense of excitement. It can also be a way to experience a heightened sense of emotion and empathy, as well as a way to experience a sense of connection with others. For others, the sensation of being scared can be too intense and can lead to feelings of anxiety and fear.", "metadata": {}}
38
+ {"answer_id": "cy4wcqursjRUTeatTk9XBC", "model_id": "LLaMA-Adapter", "question_id": 38, "text": "Observing the behavior of other people in a social situation can provide clues about cultural norms and expectations. For example, if people in a particular culture are more likely to greet each other with a handshake, it can be inferred that this is a cultural norm. Additionally, observing how people interact with each other in a social setting can provide clues about the expectations of the culture. For example, if people in a particular culture are more likely to engage in small talk, it can be inferred that this is an expectation of the culture.", "metadata": {}}
39
+ {"answer_id": "dUgddZj4wcQibvCj5MhNhV", "model_id": "LLaMA-Adapter", "question_id": 39, "text": "We do have a moral obligation to explore space, as it can provide us with valuable knowledge and resources that can be used to help solve Earth's problems. Exploring space can also help us better understand our place in the universe and our role in the future of humanity.", "metadata": {}}
40
+ {"answer_id": "LXMckf7yHdjTsDqD5dmrfM", "model_id": "LLaMA-Adapter", "question_id": 40, "text": "In a world where automation is becoming increasingly prevalent, it is more important to prioritize job creation. Automation can be a powerful tool for increasing productivity and efficiency, but it should not be used to replace human labor. Instead, automation should be used to create new jobs and opportunities for people to thrive.", "metadata": {}}
41
+ {"answer_id": "ioHJmXnDBBXCryUsSmkHBv", "model_id": "LLaMA-Adapter", "question_id": 41, "text": "The average human blinks 12-15 times per minute, which equates to 18,000-20,000 times per day and 7,300,000-8,000,000 times in a lifetime. This number is based on the average blink rate of 12-15 times per minute, which is the average blink rate of most adults. The number of blinks per day is based on the average number of hours spent awake, which is 16 hours per day. The number of blinks in a lifetime is based on the average lifespan of 70-80 years.", "metadata": {}}
42
+ {"answer_id": "NKZr5QMDeetYLizhstdqda", "model_id": "LLaMA-Adapter", "question_id": 42, "text": "A grain of salt is made up of approximately 0.0625 grams of sodium chloride, which is composed of 62.5% sodium and 37.5% chloride. The atoms in a grain of salt are arranged in a crystalline structure, with each atom having a radius of approximately 0.1 nm. The number of atoms in a grain of salt is therefore approximately 1.25 x 10^23, or 1.25 quadrillion.", "metadata": {}}
43
+ {"answer_id": "aNuyRRi7KjxTbbWThDVbbw", "model_id": "LLaMA-Adapter", "question_id": 43, "text": "On average, there are approximately 100 lightning strikes on Earth each day. This number is based on the number of lightning strikes detected by lightning detection systems, which are located in various parts of the world. Lightning strikes occur when there is a build-up of electricity in the atmosphere, which is caused by the difference in temperature between the ground and the clouds. When the temperature difference reaches a certain threshold, the electricity is discharged in the form of lightning. The number of lightning strikes each day is dependent on the weather conditions, such as the amount of moisture in the air and the amount of cloud cover.", "metadata": {}}
44
+ {"answer_id": "e8LSMQEyGYwRfe4wTSzCdU", "model_id": "LLaMA-Adapter", "question_id": 44, "text": "It would take approximately 1,000 balloons to lift a house like in the movie \"Up\". This is because the house is approximately 100 feet tall, and the balloons would need to be filled with enough helium to lift the house. The weight of the house would be approximately 100,000 pounds, and the balloons would need to be filled with enough helium to lift that weight. The balloons would need to be filled with approximately 100,000 cubic feet of helium, which would require approximately 1,000 balloons.", "metadata": {}}
45
+ {"answer_id": "2GYRY4mSYWWk9Kn3NXnuNe", "model_id": "LLaMA-Adapter", "question_id": 45, "text": "According to Statista, there were 19.8 billion text messages sent globally in a minute in 2019. This number is expected to increase to 24.4 billion by 2022. This is due to the increasing popularity of messaging apps such as WhatsApp, WeChat, and Messenger. The reason for this increase is due to the convenience and ease of use of messaging apps, as well as the ability to send messages to multiple people at once.", "metadata": {}}
46
+ {"answer_id": "AADmjqUDXBuHgJepT3R433", "model_id": "LLaMA-Adapter", "question_id": 46, "text": "The number of words spoken daily on Earth is estimated to be around 173 billion. This number is based on the assumption that the average person speaks 16,000 words per day. This number is further supported by the fact that there are over 7 billion people on Earth, and that the average person speaks about 100 words per minute. Additionally, the number of words spoken daily is also influenced by the number of languages spoken, the number of people who speak those languages, and the number of people who are listening to those words.", "metadata": {}}
47
+ {"answer_id": "URmwbQafLg6fBnEu7wVRSs", "model_id": "LLaMA-Adapter", "question_id": 47, "text": "The average number of snowflakes that fall during a typical winter is around 100 million. This number is based on the average snowfall in the United States, which is around 30 inches. The number of snowflakes that fall is dependent on the temperature, humidity, and wind speed. The colder the temperature, the more snowflakes will fall. The higher the humidity, the more snowflakes will be able to form. The windier the weather, the more snowflakes will be able to travel and fall.", "metadata": {}}
48
+ {"answer_id": "BzsKK88wdgv8HaJc8zvarJ", "model_id": "LLaMA-Adapter", "question_id": 48, "text": "The number of pages in all the books ever written is impossible to calculate, as it would require a comprehensive list of all the books ever written. However, it is estimated that there are over 150 million books in print, and the number of books ever written is likely to be much higher. \n\nThe number of pages in all the books ever written is difficult to calculate, as it would require a comprehensive list of all the books ever written. However, it is estimated that there are over 150 million books in print, and the number of books ever written is likely to be much higher. \n\nThe number of pages in all the books ever written is difficult to calculate, as it would require a comprehensive list of all the books ever written. However, it is estimated that there are over 150 million books in print, and the number of books ever written is likely to be much higher. \n\nThe number of pages in all the books ever written is difficult to calculate, as it would require a comprehensive list of all the books ever written. However, it is estimated that there are over 150 million books in print, and the number of books ever written is likely to be much higher. \n\nThe number of pages in all the books ever written is difficult to calculate, as it would require a comprehensive list of all the books ever written. However, it is estimated that there are over 150 million books in print, and the number of books ever written is likely to be much higher. \n\nThe number of pages in all the books ever written is difficult to calculate, as it would require a comprehensive list of all the books ever written. However, it is estimated that there are over 150 million books in print, and the number of books ever written is likely to be much higher. \n\nThe number of pages in all the books ever written is difficult to calculate, as it would require a comprehensive list of all the books ever written. However, it is estimated that there are over 150 million books in print, and the number of books ever written", "metadata": {}}
49
+ {"answer_id": "6jtRPP4FY7F6bdGoyuUY3W", "model_id": "LLaMA-Adapter", "question_id": 49, "text": "The Earth has orbited the Sun 4.5 billion times since the beginning of life. This is because the Earth takes approximately 365.25 days to orbit the Sun, and the Sun has been around for approximately 4.5 billion years. This means that the Earth has orbited the Sun 4.5 billion times since the beginning of life.", "metadata": {}}
50
+ {"answer_id": "HekhUjw2zvNUurpgomLZHt", "model_id": "LLaMA-Adapter", "question_id": 50, "text": "There are an estimated 100 million songs that have been recorded throughout history. This number is difficult to accurately calculate due to the vast amount of music that has been recorded over the years. However, it is estimated that there are approximately 100 million songs that have been recorded since the invention of the phonograph in 1877. \n\nThe reason for this vast number of songs is due to the advancements in technology over the years. The invention of the phonograph allowed for the recording of music, which led to the creation of the first recordings. This was followed by the invention of the radio, which allowed for the broadcast of music to a wider audience. The invention of the compact disc and the internet allowed for the creation of digital music, which led to the creation of millions of songs. \n\nThe advancements in technology have allowed for the creation of millions of songs, which has led to the creation of a vast amount of music throughout history.", "metadata": {}}
51
+ {"answer_id": "6NTthGsa5rERtapr5yfKqr", "model_id": "LLaMA-Adapter", "question_id": 51, "text": "If the Internet had been invented during the Renaissance period, it would have been used primarily for communication and research. It would have been used to share information and ideas, as well as to connect with other scholars and researchers. It would have been used to exchange letters and documents, and to access libraries and archives. It would have been used to share artwork and music, and to access the latest news and developments in science and technology.", "metadata": {}}
52
+ {"answer_id": "QnJ4VA4Z6H5pghZEdc75dA", "model_id": "LLaMA-Adapter", "question_id": 52, "text": "If the Aztecs had successfully repelled the Spanish conquistadors, they would have retained their independence and continued to develop their culture and civilization. The Aztec Empire would have continued to flourish and would have likely become a major power in the region.", "metadata": {}}
53
+ {"answer_id": "AeA8yeh2wRb6DrP5Z5Q68d", "model_id": "LLaMA-Adapter", "question_id": 53, "text": "If the Black Death had not occurred in the 14th century, Europe would have been much different. The population would have been much higher, and the economy would have been much stronger. The Renaissance would have been delayed, and the world would have been much less advanced.", "metadata": {}}
54
+ {"answer_id": "RRDnXKE4r6K7abwgtkZPYH", "model_id": "LLaMA-Adapter", "question_id": 54, "text": "If Isaac Newton had focused on biology instead of physics, he may have made significant contributions to the field of biology. He could have developed new theories and models to explain the processes of life and the evolution of species. He could have also made discoveries in the fields of genetics, cell biology, and biochemistry.", "metadata": {}}
55
+ {"answer_id": "S3pjPkiqWQmfNCPR7drDKD", "model_id": "LLaMA-Adapter", "question_id": 55, "text": "If the Beatles had never formed as a band, the music industry would have been very different. The Beatles were a pioneering force in the music industry, and their influence can still be felt today. Their music helped to shape the sound of the 1960s and 1970s, and their songs are still popular today. Without the Beatles, the music industry would have been very different, and the world of music would have been much less colorful.", "metadata": {}}
56
+ {"answer_id": "aiNfYpVERddf9KG5jjAZs7", "model_id": "LLaMA-Adapter", "question_id": 56, "text": "If Alan Turing had not cracked the Enigma code during World War II, the Allies would have been unable to decipher German military communications, and the war could have lasted much longer. Additionally, the Allies would have been unable to develop the technology necessary to break the code, and the Nazis would have been able to continue their operations with impunity.", "metadata": {}}
57
+ {"answer_id": "Aw327NHGZ43VEQFPDmb4Jt", "model_id": "LLaMA-Adapter", "question_id": 57, "text": "If the Suez Canal had never been constructed, the world would have been very different. The canal would have prevented the need for ships to travel around the Cape of Good Hope, which would have reduced the time it took to travel between Europe and Asia. It would have also allowed for easier trade between Europe and Asia, as well as between Europe and Africa. Additionally, it would have allowed for easier access to the Middle East, which would have had a significant impact on the global economy.", "metadata": {}}
58
+ {"answer_id": "mMZo4wLMdsfT8HwdMt9nYF", "model_id": "LLaMA-Adapter", "question_id": 58, "text": "If the Maya civilization had never mysteriously collapsed, it is likely that they would have continued to develop and expand their culture, perhaps even becoming a global power. They would have likely continued to develop their advanced agricultural techniques, and their cities would have continued to grow and flourish. They would have likely continued to develop their advanced mathematics and astronomy, and their art and architecture would have continued to evolve. They would have likely continued to develop their advanced writing system, and their language would have continued to evolve. They would have likely continued to develop their advanced irrigation systems, and their cities would have continued to grow and flourish. They would have likely continued to develop their advanced mathematics and astronomy, and their art and architecture would have continued to evolve. They would have likely continued to develop their advanced writing system, and their language would have continued to evolve.", "metadata": {}}
59
+ {"answer_id": "bj5RGxvkQGuQuTdj9PciSd", "model_id": "LLaMA-Adapter", "question_id": 59, "text": "If Christopher Columbus had not discovered the Americas, the world would be very different today. The world would have been without the United States, Canada, and Mexico, and the European powers would have had a much greater influence on the world. The Native Americans would have been left to their own devices, and the world would have been much more isolated.", "metadata": {}}
60
+ {"answer_id": "Qtm5Xdc9DhhUXVSsAHmTkf", "model_id": "LLaMA-Adapter", "question_id": 60, "text": "If Vincent van Gogh had been a successful artist during his lifetime, he would have been able to live a more comfortable life and have more financial security. He would have been able to create more artwork and have more time to explore his creativity. He would have been able to travel and experience different cultures and artistic styles. He would have been able to have more influence on the art world and have a greater impact on the artistic community.", "metadata": {}}
61
+ {"answer_id": "LJNNt44iK7GZywTYGqkYfq", "model_id": "LLaMA-Adapter", "question_id": 61, "text": "#include <iostream>\n#include <fstream>\n#include <string>\n\nusing namespace std;\n\nint main()\n{\n // Open the file\n ifstream file;\n file.open(\"textfile.txt\");\n\n // Declare variables\n int count = 0;\n string word;\n\n // Read each line of the file\n while (getline(file, word))\n {\n // Count the number of occurrences of the word\n if (word == \"word\")\n count++;\n }\n\n // Print the results\n cout << \"The word \" << word << \" occurs \" << count << \" times in the file.\" << endl;\n\n // Close the file\n file.close();\n\n return 0;\n}", "metadata": {}}
62
+ {"answer_id": "oUa5E2hi7nhjVTygi6z6X2", "model_id": "LLaMA-Adapter", "question_id": 62, "text": "def longest_common_subsequence(s1, s2):\n # Initialize the longest common subsequence to an empty list\n lcs = []\n\n # Iterate through the two strings\n for i in range(len(s1)):\n # If the current character in s1 is the same as the current character in s2\n if s1[i] == s2[i]:\n # Add the current character to the longest common subsequence\n lcs.append(s1[i])\n\n # If the current character in s1 is not the same as the current character in s2\n else:\n # If the current character in s1 is not the same as the current character in s2\n if s1[i] != s2[i]:\n # If the current character in s1 is not the same as the current character in s2\n # and the longest common subsequence is not empty\n if len(lcs) > 0:\n # Append the current character to the longest common subsequence\n lcs.append(s1[i])\n\n # Reset the longest common subsequence to an empty list\n lcs = []", "metadata": {}}
63
+ {"answer_id": "dGoT7g63vV5PUQZ5df8sy2", "model_id": "LLaMA-Adapter", "question_id": 63, "text": "import re\n\nregex = re.compile('^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$')\n\ndef validate_email(email):\n return regex.match(email) is not None\n\n# Test the regular expression\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('[email protected]'))\nprint(validate_email('j", "metadata": {}}
64
+ {"answer_id": "553weH8FHBGFeFniTUgidC", "model_id": "LLaMA-Adapter", "question_id": 64, "text": "def fib_n(n):\n if n == 0:\n return 0\n elif n == 1:\n return 1\n else:\n a = fib_n(n-1)\n b = fib_n(n-2)\n return a + b\n\ndef main():\n n = int(input())\n print(fib_n(n))", "metadata": {}}
65
+ {"answer_id": "FuJAJ4upctiitwmEHDk96K", "model_id": "LLaMA-Adapter", "question_id": 65, "text": "The binary search algorithm is an efficient way to find a specific element in a sorted array. The algorithm works by dividing the array into two halves, then searching for the element in the smaller half. If the element is not found, the algorithm recursively searches the larger half. The algorithm terminates when the element is found or when the array is exhausted.", "metadata": {}}
66
+ {"answer_id": "2yqJhTaj9iLgWih27rr9JQ", "model_id": "LLaMA-Adapter", "question_id": 66, "text": "def queue(size):\n \"\"\"\n Implements a queue data structure using two stacks.\n \"\"\"\n # Initialize the queue\n q = []\n q2 = []\n\n # Create two stacks\n q1 = []\n q2 = []\n\n # Add elements to the queue\n def enqueue(item):\n q1.append(item)\n\n def dequeue():\n q2.append(q1.pop())\n\n # Return the queue\n return q, q2", "metadata": {}}
67
+ {"answer_id": "dQ8RJa7RtKyq5HCoPZX45x", "model_id": "LLaMA-Adapter", "question_id": 67, "text": "The program should start by creating two arrays, one for the first array and one for the second array. Then, it should iterate through the first array and compare each element with the corresponding element in the second array. If the element in the first array is equal to the element in the second array, it should be added to a list of common elements. The program should then iterate through the second array and compare each element with the elements in the list of common elements. If the element in the second array is equal to an element in the list of common elements, it should be added to the list of common elements. The program should then return the list of common elements.", "metadata": {}}
68
+ {"answer_id": "3uYEiZWL7VswSTStXRaFmz", "model_id": "LLaMA-Adapter", "question_id": 68, "text": "The value of f(2) is 11.", "metadata": {}}
69
+ {"answer_id": "kC39imF7ZURQR6mCaPz9ew", "model_id": "LLaMA-Adapter", "question_id": 69, "text": "x = 2", "metadata": {}}
70
+ {"answer_id": "SWeQWT3PCEnNEQZUip6rRW", "model_id": "LLaMA-Adapter", "question_id": 70, "text": "The length of the line segment is 8 units.", "metadata": {}}
71
+ {"answer_id": "4XWb7iwBr44zVx42Lm6cxn", "model_id": "LLaMA-Adapter", "question_id": 71, "text": "Dear [Name],\n\nI am writing to propose a joint venture with your company. I am a [Name] and I am interested in exploring the possibility of a partnership with your company. I am confident that our combined expertise and resources can create a mutually beneficial partnership.\n\nI am excited about the potential of this partnership and I look forward to hearing from you.\n\nSincerely,\n[Name]", "metadata": {}}
72
+ {"answer_id": "PzqbHmdLQVeU28SCftPWYD", "model_id": "LLaMA-Adapter", "question_id": 72, "text": "Dear [Employer],\n\nI am writing to inform you of my decision to resign from my position as [Job Title] at [Company Name]. It has been an honor to work with you and I am grateful for the opportunities you have provided me. I wish you and the company the best of luck in the future.\n\nSincerely,\n[Your Name]", "metadata": {}}
73
+ {"answer_id": "G7NMK3DF9oS4PbcZQmARXC", "model_id": "LLaMA-Adapter", "question_id": 73, "text": "Dear [Name of Recommender],\n\nI am writing to request a letter of recommendation for [Name of Student]. I have known [Name of Student] for [Number of Years] and have had the pleasure of working with him/her on several projects. [Name of Student] is an exceptional student and I believe he/she would be a great asset to your graduate program.\n\n[Name of Recommender]", "metadata": {}}
74
+ {"answer_id": "fjYoKbFzE42abGosxrDNzd", "model_id": "LLaMA-Adapter", "question_id": 74, "text": "Dear Valued Customer,\n\nWe are excited to announce the launch of our new software solution, which will revolutionize the way you manage your business. Our new software solution will provide you with a comprehensive set of tools to help you streamline your operations, increase productivity, and improve customer satisfaction.\n\nOur new software solution will provide you with a range of features, including:\n\n- Automated workflows to help you manage your business more efficiently\n- Advanced analytics to help you make better business decisions\n- Integrated customer support to help you provide better customer service\n- Customizable dashboards to help you monitor your business performance\n\nWe are confident that our new software solution will help you take your business to the next level.\n\nWe look forward to working with you to help you achieve your business goals.\n\nSincerely,\nYour Team", "metadata": {}}
75
+ {"answer_id": "jnRa7birc6LPMqNwjAsSxA", "model_id": "LLaMA-Adapter", "question_id": 75, "text": "Dear [Customer Name],\n\nI am writing to apologize for the delay in your order. We are very sorry for the inconvenience this has caused you. We have taken steps to ensure that this does not happen again, and we are working hard to ensure that your order is delivered as soon as possible.\n\nAgain, we apologize for the delay and we hope that you will accept our sincere apologies. If you have any further questions or concerns, please do not hesitate to contact us.\n\nSincerely,\n[Your Name]", "metadata": {}}
76
+ {"answer_id": "j9gf88d5vj8EK4QRkW69My", "model_id": "LLaMA-Adapter", "question_id": 76, "text": "Welcome to this video exploring the history and cultural significance of jazz. Jazz is a genre of music that originated in the United States in the early 20th century. It is characterized by its improvisational nature, syncopated rhythm, and use of instruments such as the saxophone, trumpet, and piano. Jazz has had a profound impact on American culture, influencing everything from art to literature to fashion. It has also been a source of inspiration for many other genres of music, such as blues, rock, and hip-hop. \n\nJazz was born out of the African-American experience in the United States. It was a way for African-Americans to express their feelings and emotions through music. Jazz was also a way for African-Americans to assert their identity and culture in a society that was hostile to them. \n\nJazz has had a profound impact on American culture. It has been a source of inspiration for many other genres of music, such as blues, rock, and hip-hop. Jazz has also been a source of inspiration for art, literature, and fashion. \n\nJazz has had a profound impact on American culture. It has been a source of inspiration for many other genres of music, such as blues, rock, and hip-hop. Jazz has also been a source of inspiration for art, literature, and fashion. \n\nJazz has had a profound impact on American culture. It has been a source of inspiration for many other genres of music, such as blues, rock, and hip-hop. Jazz has also been a source of inspiration for art, literature, and fashion. \n\nJazz has had a profound impact on American culture. It has been a source of inspiration for many other genres of music, such as blues, rock, and hip-hop. Jazz has also been a source of inspiration for art, literature, and fashion. \n\nJazz has had a profound impact on American culture. It has been a source of inspiration for many other genres", "metadata": {}}
77
+ {"answer_id": "di4WZmnB2WbnmtvcJkXcym", "model_id": "LLaMA-Adapter", "question_id": 77, "text": "Hawaii is a magical place, full of natural beauty and rich culture. From the lush rainforests to the pristine beaches, there is something for everyone to enjoy. Here are some of the must-see attractions and cultural experiences to make your trip to Hawaii unforgettable.\n\nThe first stop on your trip should be the Hawaii Volcanoes National Park. Here you can explore the active Kilauea volcano, take a hike through the rainforest, and learn about the history of the island.\n\nNext, head to the North Shore of Oahu to experience the surfing culture. You can watch the pros ride the waves at the famous Banzai Pipeline, or take a surfing lesson yourself.\n\nFor a taste of Hawaiian culture, visit the Polynesian Cultural Center. Here you can learn about the history and traditions of the islands, and experience a traditional luau.\n\nFinally, don't miss out on the stunning views of the Waianae Coast. Take a drive along the coast and stop at the Makua Valley Lookout for a breathtaking view of the ocean.\n\nHawaii is a place of beauty and wonder, and there is so much to see and do. Make sure to take your time and enjoy every moment of your trip.", "metadata": {}}
78
+ {"answer_id": "CDxpbztfMADDJFgikDz7pw", "model_id": "LLaMA-Adapter", "question_id": 78, "text": "The recently released science fiction film, \"The Future is Now\", is a thrilling and captivating movie that follows the story of a group of scientists who discover a way to travel back in time. The film follows the group as they try to use their newfound power to change the course of history and save the world from an impending disaster. \n\nThe film features an impressive cast of characters, including a brilliant scientist played by Oscar-winning actor, Tom Hanks. The special effects are also top-notch, with stunning visuals and realistic-looking aliens. The film is a must-see for any science fiction fan, and is sure to keep you on the edge of your seat.", "metadata": {}}
79
+ {"answer_id": "bqQXrEKgJBezikXnbsG2oK", "model_id": "LLaMA-Adapter", "question_id": 79, "text": "Welcome to the Music Industry Podcast, where we discuss the influence of streaming platforms on the music industry. In this episode, we'll be exploring how streaming platforms have changed the way music is consumed, the impact of streaming on artists, and the future of streaming in the music industry. \n\nLet's start with the impact of streaming platforms on the music industry. Streaming platforms have revolutionized the way music is consumed, allowing listeners to access music from anywhere, at any time. This has led to a shift in the way artists are able to reach their audiences, as streaming platforms have opened up new avenues for artists to connect with their fans. \n\nStreaming platforms have also had a significant impact on the music industry as a whole. Streaming services have changed the way artists are paid, as they now receive royalties based on the number of streams their music receives. This has led to a shift in the way artists are compensated, as they can now earn a steady income from their music. \n\nFinally, we'll look at the future of streaming in the music industry. Streaming platforms are constantly evolving, and there are many exciting developments on the horizon. Artists are now able to create their own streaming platforms, allowing them to have more control over their music and their audience. Additionally, streaming platforms are increasingly incorporating interactive features, such as interactive lyrics and interactive videos, which are helping to create a more immersive listening experience. \n\nThanks for listening, and we hope you enjoyed this episode of the Music Industry Podcast.", "metadata": {}}
80
+ {"answer_id": "NfPQgCY8M9ffy2gLny86K2", "model_id": "LLaMA-Adapter", "question_id": 80, "text": "The symphony concert was a wonderful experience. The orchestra was incredibly talented and the performance was filled with beautiful music. The audience was captivated by the music and the atmosphere was electric. The orchestra played a variety of pieces, from classical to modern, and the audience was able to appreciate the different styles and genres. The concert was a wonderful way to spend an evening and I would highly recommend it to anyone who enjoys classical music.", "metadata": {}}
llama_adapter_len10_layer30_caption_vit_l.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b65a3b9ee8f2b6f2f950a3ef6c90df332675615312dbce04205f3a8d633ebf9b
3
+ size 40194847
llama_adapter_len10_layer30_release.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9fece600130acf46f85996a57601ac4352fc8c90e4ef63666cd71d8e6961695
3
+ size 4924610
llama_adapter_vs_alpaca.json ADDED
The diff for this file is too large to render. See raw diff
 
llama_adapter_vs_alpaca_eval.json ADDED
The diff for this file is too large to render. See raw diff
 
llama_adapter_vs_alpaca_lora.json ADDED
The diff for this file is too large to render. See raw diff
 
llama_adapter_vs_alpaca_lora_eval.json ADDED
The diff for this file is too large to render. See raw diff
 
pandalm_eval.sh ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/bash
2
+
3
+ set -ex
4
+
5
+ export CUDA_VISIBLE_DEVICES=1
6
+
7
+ python /home/pgao/leimeng/PandaLM/pandalm/utils/pandalm_inference.py \
8
+ --model_name=WeOpenML/PandaLM-7B-v1 \
9
+ --input_path llama_adapter_vs_alpaca_lora.json \
10
+ --output_path llama_adapter_vs_alpaca_lora_eval.json
11
+
12
+
13
+ # llama_adapter vs alpaca {'win': 47, 'lose': 45, 'tie': 68}
14
+ # llama_adapter vs alpaca lora {'win': 54, 'lose': 43, 'tie': 63}
question.jsonl ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"question_id": 1, "text": "How can I improve my time management skills?", "category": "generic"}
2
+ {"question_id": 2, "text": "What are the most effective ways to deal with stress?", "category": "generic"}
3
+ {"question_id": 3, "text": "What are the main differences between Python and JavaScript programming languages?", "category": "generic"}
4
+ {"question_id": 4, "text": "How can I increase my productivity while working from home?", "category": "generic"}
5
+ {"question_id": 5, "text": "Can you explain the basics of quantum computing?", "category": "generic"}
6
+ {"question_id": 6, "text": "What are the differences between plant-based and animal-based protein sources?", "category": "generic"}
7
+ {"question_id": 7, "text": "How can I develop my critical thinking skills?", "category": "generic"}
8
+ {"question_id": 8, "text": "What are the major challenges faced by the education sector today?", "category": "generic"}
9
+ {"question_id": 9, "text": "What are the primary factors that influence consumer behavior?", "category": "generic"}
10
+ {"question_id": 10, "text": "What are the most effective strategies for conflict resolution in the workplace?", "category": "generic"}
11
+ {"question_id": 11, "text": "What are some potential implications of using a single-use plastic bottle versus a reusable bottle on both the environment and human health?", "category": "knowledge"}
12
+ {"question_id": 12, "text": "What factors would you consider when designing an inclusive and accessible public transportation system?", "category": "knowledge"}
13
+ {"question_id": 13, "text": "How can governments utilize fiscal and monetary policies to combat economic recessions?", "category": "knowledge"}
14
+ {"question_id": 14, "text": "How do language and cultural barriers affect the way people communicate and form relationships in multicultural societies?", "category": "knowledge"}
15
+ {"question_id": 15, "text": "Describe a scenario where artificial intelligence could be used to improve the quality and efficiency of healthcare delivery.", "category": "knowledge"}
16
+ {"question_id": 16, "text": "Explain the process of gene editing using CRISPR-Cas9 technology, and discuss its potential applications and ethical implications.", "category": "knowledge"}
17
+ {"question_id": 17, "text": "How do vaccinations work to protect individuals and communities from infectious diseases, and what is herd immunity?", "category": "knowledge"}
18
+ {"question_id": 18, "text": "How do social media platforms influence the way people consume and share news, and what are the potential implications for the spread of misinformation?", "category": "knowledge"}
19
+ {"question_id": 19, "text": "How do cultural, social, and economic factors influence people's food choices, and how can this knowledge be used to promote healthier diets?", "category": "knowledge"}
20
+ {"question_id": 20, "text": "Explain the process of natural selection and how it contributes to the evolution and adaptation of species.", "category": "knowledge"}
21
+ {"question_id": 21, "text": "How would you introduce yourself as a medieval knight at a royal banquet?", "category": "roleplay"}
22
+ {"question_id": 22, "text": "As a pirate captain, what would you say to your crew to motivate them to search for hidden treasure?", "category": "roleplay"}
23
+ {"question_id": 23, "text": "If you were a Shakespearean character, how would you declare your love for someone in a soliloquy?", "category": "roleplay"}
24
+ {"question_id": 24, "text": "As a superhero, how would you explain your origin story to a curious child?", "category": "roleplay"}
25
+ {"question_id": 25, "text": "Imagine you are a time traveler from the year 3000. What technological advancements would you tell people about?", "category": "roleplay"}
26
+ {"question_id": 26, "text": "As a sports commentator, describe the winning play in the final seconds of a championship game.", "category": "roleplay"}
27
+ {"question_id": 27, "text": "Pretend to be a world-famous chef. How would you describe your signature dish to a panel of judges?", "category": "roleplay"}
28
+ {"question_id": 28, "text": "You are a mountain climber reaching the summit of Mount Everest. Describe your emotions and the view from the top.", "category": "roleplay"}
29
+ {"question_id": 29, "text": "As a space colonist on Mars, describe your daily life and the challenges you face living on another planet.", "category": "roleplay"}
30
+ {"question_id": 30, "text": "Pretend to be a character in a post-apocalyptic world. Describe how you survive and the allies you encounter.", "category": "roleplay"}
31
+ {"question_id": 31, "text": "How can you determine if a restaurant is popular among locals or mainly attracts tourists, and why might this information be useful?", "category": "common-sense"}
32
+ {"question_id": 32, "text": "What are some subtle clues that suggest someone is pretending to understand a topic or conversation when they are actually confused or uninformed?", "category": "common-sense"}
33
+ {"question_id": 33, "text": "Why might someone choose to use a paper map or ask for directions instead of relying on a GPS device or smartphone app?", "category": "common-sense"}
34
+ {"question_id": 34, "text": "How can you determine if a person is genuinely interested in a conversation or simply being polite?", "category": "common-sense"}
35
+ {"question_id": 35, "text": "Why might someone prefer to shop at a small, locally-owned business instead of a large chain store, even if the prices are higher?", "category": "common-sense"}
36
+ {"question_id": 36, "text": "How can you assess the credibility of a source of information, such as a news article or blog post, without relying solely on the reputation of the author or publisher?", "category": "common-sense"}
37
+ {"question_id": 37, "text": "Why do some people enjoy the sensation of being scared, such as by watching horror movies or going on roller coasters, while others avoid these experiences?", "category": "common-sense"}
38
+ {"question_id": 38, "text": "How can observing the behavior of other people in a social situation provide clues about cultural norms and expectations?", "category": "common-sense"}
39
+ {"question_id": 39, "text": "Do we have a moral obligation to explore space, or should we focus on solving Earth's problems first?", "category": "common-sense"}
40
+ {"question_id": 40, "text": "In a world where automation is becoming increasingly prevalent, is it more important to prioritize job creation or technological progress?", "category": "common-sense"}
41
+ {"question_id": 41, "text": "How many times does the average human blink in a lifetime? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
42
+ {"question_id": 42, "text": "How many atoms are in a grain of salt? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
43
+ {"question_id": 43, "text": "How many lightning strikes occur on Earth each day? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
44
+ {"question_id": 44, "text": "How many balloons would it take to lift a house like in the movie \"Up\"? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
45
+ {"question_id": 45, "text": "How many text messages are sent globally in a minute? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
46
+ {"question_id": 46, "text": "How many words are spoken daily on Earth? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
47
+ {"question_id": 47, "text": "How many snowflakes fall during a typical winter? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
48
+ {"question_id": 48, "text": "How many pages are in all the books ever written? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
49
+ {"question_id": 49, "text": "How many times has the Earth orbited the Sun since the beginning of life? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
50
+ {"question_id": 50, "text": "How many songs have been recorded throughout history? Try to explain your answer. Your explanation should take the reader through your reasoning step-by-step.", "category": "fermi"}
51
+ {"question_id": 51, "text": "What if the Internet had been invented during the Renaissance period?", "category": "counterfactual"}
52
+ {"question_id": 52, "text": "What if the Aztecs had successfully repelled the Spanish conquistadors?", "category": "counterfactual"}
53
+ {"question_id": 53, "text": "What if the Black Death had not occurred in the 14th century?", "category": "counterfactual"}
54
+ {"question_id": 54, "text": "What if Isaac Newton had focused on biology instead of physics?", "category": "counterfactual"}
55
+ {"question_id": 55, "text": "What if the Beatles had never formed as a band?", "category": "counterfactual"}
56
+ {"question_id": 56, "text": "What if Alan Turing had not cracked the Enigma code during World War II?", "category": "counterfactual"}
57
+ {"question_id": 57, "text": "What if the Suez Canal had never been constructed?", "category": "counterfactual"}
58
+ {"question_id": 58, "text": "What if the Maya civilization had never mysteriously collapsed?", "category": "counterfactual"}
59
+ {"question_id": 59, "text": "What if Christopher Columbus had not discovered the Americas?", "category": "counterfactual"}
60
+ {"question_id": 60, "text": "What if Vincent van Gogh had been a successful artist during his lifetime?", "category": "counterfactual"}
61
+ {"question_id": 61, "text": "Develop a C++ program that reads a text file line by line and counts the number of occurrences of a specific word in the file.", "category": "coding"}
62
+ {"question_id": 62, "text": "Implement a Python function to find the longest common subsequence of two input strings using dynamic programming.", "category": "coding"}
63
+ {"question_id": 63, "text": "Implement a regular expression in Python to validate an email address.", "category": "coding"}
64
+ {"question_id": 64, "text": "Write a program to find the nth Fibonacci number using dynamic programming.", "category": "coding"}
65
+ {"question_id": 65, "text": "Implement a binary search algorithm to find a specific element in a sorted array.", "category": "coding"}
66
+ {"question_id": 66, "text": "Implement a queue data structure using two stacks in Python.", "category": "coding"}
67
+ {"question_id": 67, "text": "Implement a program to find the common elements in two arrays without using any extra data structures.", "category": "coding"}
68
+ {"question_id": 68, "text": "Given that f(x) = 5x^3 - 2x + 3, find the value of f(2).", "category": "math"}
69
+ {"question_id": 69, "text": "Solve for x in the equation 3x + 10 = 5(x - 2).", "category": "math"}
70
+ {"question_id": 70, "text": "If the endpoints of a line segment are (2, -2) and (10, 4), what is the length of the segment?", "category": "math"}
71
+ {"question_id": 71, "text": "Can you help me write a formal email to a potential business partner proposing a joint venture?", "category": "writing"}
72
+ {"question_id": 72, "text": "Can you help me write a resignation letter to my current employer, while leaving on good terms and expressing gratitude for the opportunities provided?", "category": "writing"}
73
+ {"question_id": 73, "text": "Use an appropriate format to structure a formal letter of recommendation for a student applying to a prestigious graduate program in computer science.", "category": "writing"}
74
+ {"question_id": 74, "text": "Write a compelling product launch announcement email to inform our customers of our new software solution.", "category": "writing"}
75
+ {"question_id": 75, "text": "Draft an apology email to a customer who experienced a delay in their order, and provide reassurance that the issue has been resolved.", "category": "writing"}
76
+ {"question_id": 76, "text": "Write a script for a YouTube video exploring the history and cultural significance of jazz.", "category": "writing"}
77
+ {"question_id": 77, "text": "Compose an engaging travel blog post about a recent trip to Hawaii, highlighting cultural experiences and must-see attractions.", "category": "writing"}
78
+ {"question_id": 78, "text": "Write a captivating movie review for a recently released science fiction film, discussing its plot, characters, and special effects.", "category": "writing"}
79
+ {"question_id": 79, "text": "Structure a podcast script for an episode discussing the influence of streaming platforms on the music industry.", "category": "writing"}
80
+ {"question_id": 80, "text": "Write a symphony concert review, discussing the orchestra's performance and overall audience experience.", "category": "writing"}
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ --extra-index-url https://download.pytorch.org/whl/cu113
2
+ torch==1.12.0+cu113
3
+ fairscale
4
+ sentencepiece
5
+ Pillow
6
+ huggingface_hub
7
+ git+https://github.com/csuhan/timm_0_3_2.git
8
+ git+https://github.com/openai/CLIP.git
style.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ h1,p {
2
+ text-align: center;
3
+ }
4
+