Skip to content

Commit

Permalink
RELEASE: 0.0.1a33
Browse files Browse the repository at this point in the history
  • Loading branch information
brucewlee committed Mar 9, 2024
1 parent 6ff2ea5 commit 2be56b6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
26 changes: 0 additions & 26 deletions nutcracker/data/instance_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,32 +82,6 @@ def sample(self, n: int, seed: Optional[int] = None, in_place: bool = True) -> O



def stylistic_sample(self, n: int, in_place: bool = True) -> Optional[list]:
"""
Samples 'n' instances that are the furthest apart stylistically.
Args:
n (int): The number of instances to sample.
seed (Optional[int]): Optional random seed for reproducibility.
Returns:
List: A list of 'n' spaCy Doc objects sampled based on their stylistic differences.
"""
if n > len(self.instances):
raise ValueError("Sample size 'n' cannot be greater than the total number of instances.")
nlp = spacy.load("en_core_web_sm")
for instances in

sampled_indices = random.sample(range(len(self.instances)), n)

if in_place:
self.instances = [self.instances[i] for i in sampled_indices]
return None
else:
return [self.instances[i] for i in sampled_indices]



def get_max_token_length_user_prompt(self) -> int:
"""Find the maximum user prompt length across all instances.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from distutils.core import setup
from setuptools import find_packages

this_version='0.0.1a32'
this_version='0.0.1a33'

# python setup.py sdist
# python -m twine upload dist/*
Expand Down

0 comments on commit 2be56b6

Please sign in to comment.