Skip to content

Commit 2938a00

Browse files
Ask for star in a deterministic nature after model download
1 parent 2c1fcef commit 2938a00

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/pipelines/text2text-generation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require_once './bootstrap.php';
66

77
use Codewithkyrian\Transformers\Generation\Streamers\StdOutStreamer;
8-
use function Codewithkyrian\Transformers\{Pipelines\pipeline};
8+
use function Codewithkyrian\Transformers\{Pipelines\pipeline, Utils\memoryUsage, Utils\timeUsage};
99

1010
ini_set('memory_limit', -1);
1111

@@ -21,5 +21,5 @@
2121

2222
$output = $generator($query, streamer: $streamer, maxNewTokens: 256, doSample: true, repetitionPenalty: 1.1, temperature: 0.7);
2323

24-
dd($output);
25-
//dd('Done', timeUsage(), memoryUsage());
24+
//dd($output);
25+
dd('Done', timeUsage(), memoryUsage());

src/Commands/DownloadModelCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7575
$progressBar = $this->getProgressBar($filename, $output);
7676
$percent = round(($downloaded / $downloadSize) * 100, 2);
7777
$progressBar->setProgress((int)$percent);
78-
}
79-
elseif ($type === 'complete_download') {
78+
} elseif ($type === 'complete_download') {
8079
$progressBar = $this->getProgressBar($filename, $output);
8180
$progressBar->finish();
8281
$output->writeln('');
@@ -92,7 +91,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9291

9392
$output->writeln('✔ Model files downloaded successfully.');
9493

95-
$this->askToStar($input, $output);
94+
$random = random_int(1, 100);
95+
if ($random <= 30) $this->askToStar($input, $output);
9696

9797
return Command::SUCCESS;
9898
} catch (Exception $e) {

0 commit comments

Comments
 (0)