Skip to content

Commit

Permalink
Update scripts to the new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Maischein committed Apr 13, 2024
1 parent 8b79fdc commit 6a46366
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scripts/code-completion.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ package main;
my @prompts = @ARGV ? @ARGV : (qq{fetch an url and print its content with Mojolicious; write concise code <PRE> sub fetch {\n <SUF> } <MID>});

for my $prompt (@prompts) {
my $responses = $ol->generateCompletion(
my $response = $ol->generateCompletion(
model => $model,
prompt => $prompt,
system => 'You are a helpful concise coding assistant',
);

my $code;
my $responses = $response->get;
repeat {
my ($res) = $responses->shift;
my $info;
Expand Down
3 changes: 2 additions & 1 deletion scripts/describe-image.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ package main;
my @images = @ARGV ? @ARGV : ('t/testdata/objectdetection.jpg');

for my $image (@images) {
my $responses = $ol->generateCompletion(
my $response = $ol->generateCompletion(
model => 'llava:latest',
prompt => 'You are tagging images. Please list all the objects in this image as tags. Also list the location where it was taken.',
images => [
{ filename => $image },
],
);
my $responses = $response->get;

repeat {
my ($res) = $responses->shift;
Expand Down

0 comments on commit 6a46366

Please sign in to comment.