aigeek0x0 commited on
Commit
70d27bc
·
verified ·
1 Parent(s): a7b5741

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +41 -0
README.md CHANGED
@@ -131,6 +131,47 @@ Let's break this down:
131
 
132
  ```
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  ## Evaluations
135
  We are encouraged by the initial assessments conducted using the [LLM-as-a-Judge method](https://arxiv.org/abs/2306.05685), particularly with the utilization of GPT-4. Our ongoing efforts involve a more comprehensive evaluation of the model. We have also entered this model into the HuggingFace Open Leaderboard for assessment. As we progress, we will continue to provide updates on our findings and share the results on this platform.
136
 
 
131
 
132
  ```
133
 
134
+ and if we query the model with
135
+
136
+ ```
137
+ <s>[INST]<<SYS>>You are an AI assistant. Take a deep breath, think step-by-step and respond to following instructions from the user. <</SYS>>Write a function in Python that checks if a number is prime.[/INST]
138
+
139
+ ```
140
+
141
+ the model will return
142
+
143
+ ```
144
+ The user will provide you with a positive integer and your task is to check whether it can be divided by any other number (divisors) except for one and itself (the number).
145
+ Let's say the number given by the user is 2147483647. Your first thought process should include finding the square root of this number as that'll help narrow down potential divisors. Here, sqrt(2147483647) = 46340. Next, iterate over numbers from two up to 46340 checking if they divide evenly into 2147483647 (remainder is zero when modded). If such a divisor is found, then return False since it indicates 2147483647 has additional factors besides one and itself; thus it isn't prime. Otherwise, if no such divisor is found during iteration, then return True signaling that 2147483647 is indeed a prime number.
146
+ But make sure you also consider edge cases like 2, because some programming languages might use zero-based indexing.
147
+
148
+ Here's a possible solution:
149
+
150
+ ```python
151
+ import math
152
+
153
+ def is_prime(n):
154
+ if n <= 1: # Edge case: numbers below 2 are not considered primes
155
+ return False
156
+ elif n == 2 or n == 3: # Special cases for small primes
157
+ return True
158
+ elif n % 2 == 0: # Quick filter for even numbers
159
+ return False
160
+
161
+ root = int(math.sqrt(n))
162
+
163
+ for i in range(3, root + 1, 2): # Only odd divisors needed; start at 3
164
+ if n % i == 0:
165
+ return False
166
+ return True
167
+
168
+ number = 2147483647
169
+ result = is_prime(number)
170
+ print(f"The result for {number} is:", "Prime" if result else "Not Prime")
171
+ ```
172
+
173
+ ```
174
+
175
  ## Evaluations
176
  We are encouraged by the initial assessments conducted using the [LLM-as-a-Judge method](https://arxiv.org/abs/2306.05685), particularly with the utilization of GPT-4. Our ongoing efforts involve a more comprehensive evaluation of the model. We have also entered this model into the HuggingFace Open Leaderboard for assessment. As we progress, we will continue to provide updates on our findings and share the results on this platform.
177