Skip to content

Commit

Permalink
add test script for experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
stolzenp committed Apr 3, 2024
1 parent ca5122d commit be26ac6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/small_model_training/iterative_dataset_synthesis_movies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from haystack.nodes import PromptNode
from fabricator import DatasetGenerator
from fabricator.prompts import BasePrompt

label_options = ["positive", "negative"]

prompt = BasePrompt(
task_description="Generate a {} movie review.",
label_options=label_options,
)

prompt_node = PromptNode(
model_name_or_path="mistralai/Mistral-7B-Instruct-v0.1",
max_length=100,
)

generator = DatasetGenerator(prompt_node)
generated_dataset = generator.generate(
prompt_template=prompt,
max_prompt_calls=100,
num_samples_to_generate=100,
small_model_training='text_classification',
train_small_model_every_X_generations=10

)

generated_dataset.push_to_hub("your-first-generated-dataset")

0 comments on commit be26ac6

Please sign in to comment.