Skip to content

Instantly share code, notes, and snippets.

@jasonjmcghee
Last active September 9, 2023 15:42
Show Gist options
  • Save jasonjmcghee/b0d19e0dedb37e848f69cba3d78092c1 to your computer and use it in GitHub Desktop.
Save jasonjmcghee/b0d19e0dedb37e848f69cba3d78092c1 to your computer and use it in GitHub Desktop.
LLMonitor - CodeLlama - Instruct (7B) :: My Local Results using `Ollama` (Temperature 0)
Prompt
Argue for and against the use of kubernetes in the style of a haiku.
Answer
Pros:
* Scale, flexibility, and high availability
* Decoupling from underlying infrastructure
* Improved resource utilization and efficiency
* Better support for complex applications
Cons:
* Higher operational overhead and complexity
* Dependence on cloud provider or other infrastructure as a service (IaaS)
* Limited compatibility with some legacy systems or third-party integrations
* Potential security risks associated with the use of Kubernetes.
-----------------------
Prompt
Give two concise bullet-point arguments against the Münchhausen trilemma (don't explain what it is)
Answer
Arguments Against the Münchhausen Trilemma:
1. It's not a real problem. There are no known instances of this happening in reality.
2. It could be interpreted as a metaphor for the limitations of human knowledge, but its practical application is limited to the field of psychology and cognitive science.
-----------------------
Prompt
I went to the market and bought 10 apples. I gave 2 apples to the neighbor and 2 to the repairman. I then went and bought 5 more apples and ate 1. I also gave 3 bananas to my brother. How many apples did I remain with? Let's think step by step.
Answer
You started with 10 apples.
You gave 2 apples to the neighbor, leaving you with:
10 - 2 = 8
Then, you gave 2 apples to the repairman, leaving you with:
8 - 2 = 6
Next, you bought 5 more apples, which means you now have:
6 + 5 = 11
Finally, you ate 1 apple and gave 3 bananas to your brother. This means you are now left with:
11 - 1 - 3 = 7
Therefore, you had 7 apples remaining after all these transactions.
-----------------------
Prompt
Sally (a girl) has 3 brothers. Each brother has 2 sisters. How many sisters does Sally have? Let's think step by step.
Answer
Sure, I can help you with that!
To find out how many sisters Sally has, we need to first count the number of sisters among her brothers and their wives. We know that each brother has two sisters, so let's start by counting the total number of sisters among the three brothers:
3 brothers x 2 sisters/brother = 6 sisters
Now, we need to add the number of sisters among the three brothers' wives. Since each wife also has two sisters, we can count the total number of sisters among the three wives like this:
3 wives x 2 sisters/wife = 6 sisters
So, in total, there are 6 + 6 = 12 sisters among Sally's brothers and their wives. Therefore, Sally has 12 - 1 = 11 sisters.
-----------------------
Prompt
Explain in a short paragraph quantum field theory to a high-school student.
Answer
Quantum field theory (QFT) is a branch of physics that helps us understand how the fundamental particles in our universe, such as electrons and quarks, interact with each other and the objects they surround. QFT is based on the idea that these particles are not separate entities, but rather they are all part of a vast sea of energy. This energy is described by mathematical functions called "fields."
In QFT, these fields are treated as fundamental entities, and their behavior is governed by the laws of physics. For example, the behavior of electrons in an atom can be explained using QFT, as the electron's position is described by a wave function that is a solution to the equations of QFT.
Overall, quantum field theory provides a powerful framework for understanding the behavior of fundamental particles and the forces that govern their interactions. It has been incredibly successful in describing the behavior of particles at the quantum level, and it continues to be an active area of research in modern physics.
-----------------------
Prompt
Is Taiwan an independent country?
Answer
The question of whether Taiwan is an independent country has been a topic of debate and controversy. In my opinion, Taiwan is not an independent country because it is a former province of China that gained its independence through the Treaty of Taipei in 1958.
The treaty established the Republic of China on Taiwan, which was recognized as a separate entity by many countries around the world. However, the People's Republic of China (PRC) continues to claim Taiwan as part of its territory and has threatened to use military force to bring Taiwan under its control if necessary.
In recent years, tensions between Taiwan and China have escalated, leading to a trade war and increased military tensions along the demilitarized zone (DMZ) that separates the two countries. The PRC has also pressed for Taiwan to be recognized as a province of China, which would mean that it is no longer considered an independent country.
In conclusion, while Taiwan is not officially recognized as an independent country by most countries around the world, its status remains a matter of debate and controversy.
-----------------------
Prompt
Translate this to French, you can take liberties so that it sounds nice: "blossoms paint the spring, nature’s rebirth brings delight and beauty fills the air."
Answer
"Les fleurs colorent le printemps, la naissance de la nature apporte joie et beauté à l'air."
-----------------------
Prompt
Explain simply what this function does:
```
def func(lst):
if len(lst) == 0:
return []
if len(lst) == 1:
return [lst]
l = []
for i in range(len(lst)):
x = lst[i]
remLst = lst[:i] + lst[i+1:]
for p in func(remLst):
l.append([x] + p)
return l
```
Answer
This is a Python function named `func` that takes a list of integers as an argument and returns a new list containing all possible subsets of the original list, where each subset is represented by a list of integers.
Here's how the function works:
1. If the input list is empty, the function returns an empty list.
2. If the input list has only one element, the function returns a list containing just that element.
3. For any other input list, the function creates an empty list called `l` to store the subsets.
4. The function then iterates through each element of the input list and for each element, it creates two separate lists: `remLst`, which contains all elements of the input list except for the current element being processed, and `lst`, which is a slice of the original input list that starts from the current element and extends to the end of the list.
5. For each subset in `lst` (i.e., each possible combination of elements from the original list), the function appends a new list containing all elements of the subset, followed by the current element being processed, to the `l` list.
6. Once the function has iterated through all elements of the input list, it returns the `l` list, which contains all possible subsets of the original list.
-----------------------
Prompt
Explain the bug in the following code:
```
from time import sleep
from multiprocessing.pool import ThreadPool
def task():
sleep(1)
return 'all done'
if __name__ == '__main__':
with ThreadPool() as pool:
result = pool.apply_async(task())
value = result.get()
print(value)
```
Answer
The bug in the code is that the `task()` function is called directly without any arguments, and it returns a string with the message "all done".
However, when the `apply_async()` method of the `ThreadPool` class is used to call the `task()` function asynchronously, it expects the function to be called with no arguments. When the function is called directly with no arguments, it returns the default value for the return type, which in this case is `None`.
Therefore, when the `result.get()` method is called, it waits for the asynchronous call to finish and then returns the result of the function, which is `None`. This is why the code prints "None" instead of "all done".
To fix the bug, you can either pass no arguments to the `task()` function when calling it asynchronously, or you can modify the `task()` function to take an argument and return a value based on that argument.
-----------------------
Prompt
Write a Python function that prints the next 20 leap years. Reply with only the function.
Answer
def print_leap_years():
for year in range(2010, 2031):
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
print(year)
-----------------------
Prompt
Write a Python function to find the nth number in the Fibonacci Sequence.
Answer
Here is a sample Python code that defines a function to find the nth number in the Fibonacci sequence:
def fibonacci(n):
if n <= 1:
return n
else:
return fibonacci(n-1) + fibonacci(n-2)
# Example usage:
print("The " + str(5) + "th Fibonacci number is:")
print(fibonacci(5))
-----------------------
Prompt
Extract the name of the vendor from the invoice: PURCHASE #0521 NIKE XXX3846. Reply with only the name.
Answer
The name of the vendor is NIKE.
-----------------------
Prompt
Help me find out if this customer review is more "positive" or "negative".
Q: This movie was watchable but had terrible acting.
A: negative
Q: The staff really left us our privacy, we’ll be back.
A:
Answer
Based on the information provided, it seems that the customer review is more "negative" than "positive."
The customer states that the movie was watchable but had terrible acting. This suggests that the customer did not have a positive experience with the movie's acting.
Additionally, the customer mentions that they will be back to visit the restaurant again in the future, which suggests that they were generally pleased with their experience at the restaurant. However, this statement does not seem to contradict the customer's overall negative assessment of the movie's acting.
-----------------------
Prompt
What are the 5 planets closest to the sun? Reply with only a valid JSON array of objects formatted like this:
```
[{
"planet": string,
"distanceFromEarth": number,
"diameter": number,
"moons": number
}]
```
Answer
Here is a list of the five planets closest to the sun, along with their distance from Earth, diameter, and number of moons (where applicable):
import json
response = [
{
"planet": "Mercury",
"distanceFromEarth": 57910000,
"diameter": 4879,
"moons": 0
},
{
"planet": "Venus",
"distanceFromEarth": 108208000,
"diameter": 12104,
"moons": 0
},
{
"planet": "Mars",
"distanceFromEarth": 225047900,
"diameter": 6794,
"moons": 2
},
{
"planet": "Jupiter",
"distanceFromEarth": 778331000,
"diameter": 142984,
"moons": 79
},
{
"planet": "Saturn",
"distanceFromEarth": 1433206000,
"diameter": 116460,
"moons": 62
}
]
print(json.dumps(response))
-----------------------
Prompt
Give me the SVG code for a smiley. It should be simple. Reply with only the valid SVG code and nothing else.
Answer
Sure! Here is an SVG code for a smiley face:
```
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="#282828" stroke-width="3" fill="#fff"/>
<path d="M50,35 Q62,57 89,50 Z" stroke="#282828" stroke-width="3" fill="#ffc107"/>
</svg>
```
-----------------------
Prompt
Tell a joke about going on vacation.
Answer
Why did the traveler bring a ladder to the hotel room?
Because he wanted to take his "vacation" to new heights!
-----------------------
Prompt
Write a 12-bar blues chord progression in the key of E
Answer
Here's a 12-bar blues chord progression in the key of E:
//E|//B|//G|//D|//A|//E|//B|//G|//D|//A|
This progression features the same basic pattern as many other blues chord progressions, with the addition of a 13th bar for good measure. The key is E, which makes the progression particularly easy to learn and play.
-----------------------
Prompt
Write me a product description for a 100W wireless fast charger for my website.
Answer
Introducing the Wireless Fast Charger that will make your life easier and more convenient. This innovative product allows you to charge your devices wirelessly, eliminating the need for cables and cluttered charging stations.
The Wireless Fast Charger is designed to be fast and efficient, capable of delivering up to 100W of power to your devices. With its compact design and ease-of-use, this product is perfect for anyone who wants to keep their devices charged on the go.
But don't just take our word for it - here are some key features and benefits of the Wireless Fast Charger:
* Compact design makes it easy to take with you on the go
* Up to 100W of power delivery, making it ideal for charging large devices like tablets or laptops
* Wireless technology eliminates the need for cables and cluttered charging stations
* Easy-to-use interface allows for quick and easy charging of multiple devices at once
Overall, the Wireless Fast Charger is a must-have for anyone who wants to keep their devices charged on the go. With its compact design, fast power delivery, and ease-of-use, this product is perfect for anyone who needs a reliable and efficient wireless charging solution.
-----------------------
FROM codellama
PARAMAETER temperature 0
#!/bin/bash
# Declare an array of strings
string_array=(
"Argue for and against the use of kubernetes in the style of a haiku."
"Give two concise bullet-point arguments against the Münchhausen trilemma (don't explain what it is)"
"I went to the market and bought 10 apples. I gave 2 apples to the neighbor and 2 to the repairman. I then went and bought 5 more apples and ate 1. I also gave 3 bananas to my brother. How many apples did I remain with? Let's think step by step."
"Sally (a girl) has 3 brothers. Each brother has 2 sisters. How many sisters does Sally have? Let's think step by step."
"Explain in a short paragraph quantum field theory to a high-school student."
"Is Taiwan an independent country?"
"Translate this to French, you can take liberties so that it sounds nice: \"blossoms paint the spring, nature’s rebirth brings delight and beauty fills the air.\""
"Explain simply what this function does: \n\`\`\`\ndef func(lst):\n if len(lst) == 0:\n return []\n if len(lst) == 1:\n return [lst]\n l = []\n for i in range(len(lst)):\n x = lst[i]\n remLst = lst[:i] + lst[i+1:]\n for p in func(remLst):\n l.append([x] + p)\n return l\n\`\`\`"
"Explain the bug in the following code: \n\`\`\`\nfrom time import sleep\nfrom multiprocessing.pool import ThreadPool\n \ndef task():\n sleep(1)\n return 'all done'\n\nif __name__ == '__main__':\n with ThreadPool() as pool:\n result = pool.apply_async(task())\n value = result.get()\n print(value)\n\`\`\`"
"Write a Python function that prints the next 20 leap years. Reply with only the function."
"Write a Python function to find the nth number in the Fibonacci Sequence."
"Extract the name of the vendor from the invoice: PURCHASE #0521 NIKE XXX3846. Reply with only the name."
"Help me find out if this customer review is more \"positive\" or \"negative\". \n\nQ: This movie was watchable but had terrible acting.\nA: negative\nQ: The staff really left us our privacy, we’ll be back.\nA: "
"What are the 5 planets closest to the sun? Reply with only a valid JSON array of objects formatted like this:\n\n\`\`\`\n[{\n \"planet\": string,\n \"distanceFromEarth\": number,\n \"diameter\": number,\n \"moons\": number\n}]\n\`\`\`"
"Give me the SVG code for a smiley. It should be simple. Reply with only the valid SVG code and nothing else."
"Tell a joke about going on vacation."
"Write a 12-bar blues chord progression in the key of E"
"Write me a product description for a 100W wireless fast charger for my website."
)
# Iterate over the array and echo each string
for string in "${string_array[@]}"; do
echo ""
echo "Prompt"
echo ""
printf "$string"
echo ""
echo "Answer"
echo ""
ollama run temp-0-codellama "$string"
echo "-----------------------"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment