Earlier quoted context omitted.
Ollama supports it already: `ollama run codellama:7b-instruct` https://ollama.ai/blog/run-code-llama-locally More models uploaded as we speak: https://ollama.ai/library/codellama
Isn't ollama terminal only? For code, that wouldn't be good.
Code Llama, a state-of-the-art large language model for coding
501–510 of 525 posts
Re: Code Llama, a state-of-the-art large language model for coding
#502Earlier quoted context omitted.
Are we including it just to poke the bear? Prime numbers are typically defined as numbers with no positive divisors other than one and the number in question.
A definition which marks 1 as being prime :).
-1 True
0 True
1 True
2 True
3 True
4 FalseRe: Code Llama, a state-of-the-art large language model for coding
#503Works nearly out of the box with llama.cpp, which makes it easy to try locally: https://github.com/ggerganov/llama.cpp/issues/2766 Here's some output from q4_0 quantization of CodeLlama-7b-Python (first four lines are the prompt): # prints the first ten prime numbers def print_primes(): i = 2 num_printed = 0 # end of prompt while num_printed It will be interesting to see how the larger models perform, especially afte…
Interesting here and in some of the other comments in this thread is that 1 is not a prime number ¹)! Now granted, that's more or less by definition and I don't doubt there's communities and fields where it is considered one, but still shows some of the subtleties at play when using language models. ¹) https://www.google.com/search?q=is+1+a+prime+number
-1 True
0 True
1 True
2 True
3 True
4 FalseRe: Code Llama, a state-of-the-art large language model for coding
#504>The Code Llama models provide stable generations with up to 100,000 tokens of context. Not a bad context window, but makes me wonder how embedded code models would pick that context when dealing with a codebase larger than 100K tokens. And this makes me further wonder if, when coding with such a tool (or at least a knowledge that they’re becoming more widely used and leaned on), are there some new considerations tha…
I think hypergraph is an overlooked concept in programming language theory
Re: Code Llama, a state-of-the-art large language model for coding
#505Earlier quoted context omitted.
A definition which marks 1 as being prime :).
This thread started with AI code whose correctness of is_prime no-one has questioned so far :-D -1 True 0 True 1 True 2 True 3 True 4 False
-1, 0, and 1 are no good.
Two divisors for positive integer X: 1, X
I recently demonstrated GPT-4 via by having it explain phases of matter metaphorically with animals. Though impressive, it points to loose abstraction being more in range than firm abstraction. Let’s get that model a python interpreter and see how far we can take this party. Until then, I’m going to stick to explaining concepts.
————- included here for fun
Alright! Let's dive into the wild world of matter using some animal friends as examples:
1. *Solids* - Think of solids like a herd of elephants standing closely together. The elephants are packed in tight, barely moving, just maybe swaying a bit. They're sturdy and strong, just like solid things in our world. This is because the particles in a solid don't move around much; they just vibrate in place.
2. *Liquids* - Imagine a school of fish swimming in a pond. They're free to move around, weaving in and out, but they still stay pretty close to each other. They aren't packed as tightly as our elephant friends, but they aren't completely free either. This is like liquids: the particles are close, but they can move around and flow, just like water in a glass.
3. *Gases* - Now, picture a flock of birds soaring in the sky, free to fly in all directions. These birds aren't sticking close to one another; they're spread out, enjoying the vast space of the sky. In gases, the particles are like these birds, very spread out and moving all over the place.
4. *Plasma* - Think of plasma like dragons (I know they're mythical, but bear with me). These dragons breathe fire, and that fire is so hot and energetic that it can change the way things behave. Plasma is like that – it's gas that's become so hot that the particles are super energized and can even glow, like neon lights.
5. *Bose-Einstein Condensate (BEC)* - This one's a bit trickier, but imagine penguins in Antarctica. They huddle closely together to keep warm. BEC is like the coldest group of particles ever, where they start acting in strange, uniform ways, almost like one giant super-particle. It's like all the penguins moving together as one.
So, next time you think of matter, just remember our animal friends: the sturdy elephants, the flowing fish, the free-flying birds, the fiery dragons, and the huddled penguins!
Re: Code Llama, a state-of-the-art large language model for coding
#506Re: Code Llama, a state-of-the-art large language model for coding
#507Earlier quoted context omitted.
This thread started with AI code whose correctness of is_prime no-one has questioned so far :-D -1 True 0 True 1 True 2 True 3 True 4 False
Well, I’m questioning it… not that it really matters. -1, 0, and 1 are no good. Two divisors for positive integer X: 1, X I recently demonstrated GPT-4 via by having it explain phases of matter metaphorically with animals. Though impressive, it points to loose abstraction being more in range than firm abstraction. Let’s get that model a python interpreter and see how far we can take this party. Until then, I’m going…
Again, 1 fits, because it has two divisors: 1, and 1. You never said X != 1, nor does the definition upthread.
This isn't a silly gotcha, these things matter in math. For instance, when solving a quadratic equation, allowing for the solutions to be equal lets you avoid special-casing your understanding - instead of memorizing when the equation has zero, one or two solutions, you just learn it has two or zero (real) solutions, and the two solutions are allowed to be equal.
It's perfectly reasonable understanding. Inequality isn't a natural implicit assumption. E.g. if I say you have two variables:
int a;
int b;
I doubt you'd be insisting that `a != b` at all times.Re: Code Llama, a state-of-the-art large language model for coding
#508Earlier quoted context omitted.
Well, I’m questioning it… not that it really matters. -1, 0, and 1 are no good. Two divisors for positive integer X: 1, X I recently demonstrated GPT-4 via by having it explain phases of matter metaphorically with animals. Though impressive, it points to loose abstraction being more in range than firm abstraction. Let’s get that model a python interpreter and see how far we can take this party. Until then, I’m going…
> Two divisors for positive integer X: 1, X Again, 1 fits, because it has two divisors: 1, and 1. You never said X != 1, nor does the definition upthread. This isn't a silly gotcha, these things matter in math. For instance, when solving a quadratic equation, allowing for the solutions to be equal lets you avoid special-casing your understanding - instead of memorizing when the equation has zero, one or two solutions…
An element to set relationship is that element A is or is not in set B. So, if the set of divisors only contains 1, there is only one divisor. If 1 and 1 made two divisors, 1 and 1 and 1 and… would make infinite divisors, rendering the concept of counting divisors (i.e., the cardinal number of the set of divisors) meaningless.
M is a divisor of N if it is a number that divides N without a remainder. While divisors can be negative, they are conventionally limited to non-negative integers in primality and factoring.
If you’d wanted to dig in on negative vs. positive divisors, that quickly provides an avenue for clearer formality, but piling on 1 and saying it’s not a silly gotcha is pretty fruitless. And please don’t bother to say “you didn’t say it has only two divisors”, as that would, again, be a silly argument.
So wind back and really formalize the definition if you want: A prime number is a natural number with only two divisors in the set of natural numbers, 1 and itself.
While set theory is axiomatic, it’s not practical for me (or anyone else) to explain conventional foundations to avoid someone feeling like they need to wiggle out of a prior bad argument.
Just say “ah, okay” or stop replying and move on. Feel free to read up in Wikipedia or any other texts (or ping me privately if you’d like to discuss further), but this thread isn’t looking like it’s going to meaningfully contribute to the broader discussion. Accordingly, I’ll leave it here unless something meaningful comes up.
Re: Code Llama, a state-of-the-art large language model for coding
#509Works nearly out of the box with llama.cpp, which makes it easy to try locally: https://github.com/ggerganov/llama.cpp/issues/2766 Here's some output from q4_0 quantization of CodeLlama-7b-Python (first four lines are the prompt): # prints the first ten prime numbers def print_primes(): i = 2 num_printed = 0 # end of prompt while num_printed It will be interesting to see how the larger models perform, especially afte…
I'd fail an interview candidate that suggested adding 1 each time for subsequent prime testing
The problem a team that always seeks the optimal solution is that never they get shit done. And that’s rarely optimal in a business context. Your view does not strike me to be nearly as arrogant as it is short-sighted.
I think on a team of one I want the guy who gets it done without thinking. On a team of two I want a guy that’s somewhere in the middle. And on a team of three, that’s when I want my optimiser. Because in the time that guy number 3 has written let’s say 3 files of optimal code, guy number 10 files of not optimal code. And you rarely need guy number 3 to fix all ten, you just need him to fix the one or two files that actually matter.
Clients rarely ask “is this optimal?”. But they always ask “is this done?”.
All three developers have different approaches. All three are assets.
I think on some level then you’re making the same mistake that we could say the “just add one guy” made if your comment is honest- not factoring in (his) speed.
I think code readability, rather than code optimisation is far more important thing to get hung up on in an interview (and is, I must remind some of you, not to be confused with conciseness). And you can see this in the end result. But if you’re following along and the interviewee already knows you know what’s going on because of that, you can see it in smaller ways- it could be as simple as going back and changing a variable name such as open (maybe a function?) to isOpen (almost always a Boolean value).
I think most of us are in this position pretty often where we’re writing and figuring out something at the same time, maybe we just see if it works first and don’t give a name much thought or maybe we change the actual value or type of a variable in the process and the variable name becomes ambiguous. I’d look for small indicators that shoe me that this person is considering readability. But I still don’t necessarily expect it to be as readable as it would be in a more natural setting I mean I think 90% of these sorts of things start off with the person saying “I swear I can type” within the first five minutes of being watched- if they get flustered while being watched that it effects their typing, it certainly also effects their coding as well.