Skip to content

Commit

Permalink
Commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotsayes committed Jul 24, 2024
0 parents commit ec5f249
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ai-demo/1_setup.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- Send me some wrapped arweave!!
-- Go to aox.xyz to wrap your arweave tokens. Around 0.01 should be enough
-- You should see:
-- New Message From xU9...h10: Action = Credit-Notice

-- Install APM
-- aos> .load-blueprint apm

-- Loading... apm
-- 📦 Loaded APM Client

-- Update APM
-- aos> APM.update()

-- 📤 Update request sent
-- ℹ️ Attempting to load client 1.1.0
-- 📦 Loaded APM Client
-- ✨ Client has been updated to 1.1.0

-- Install Llama-Herder
-- aos> APM.install("@sam/Llama-Herder")

-- 📤 Download request sent
-- ℹ️ Attempting to load @sam/Llama-Herder@1.0.3 package
-- 📦 Package has been loaded, you can now import it using require function
-- 📦 Downloading package bKy3WSRCw5P0G4lOBtkwpChHSl8woPKh7FTUXvOCLrs | @sam/Llama-Herder@1.0.3
-- Assignment added to outbox.

-- For details on how to use Llama-Herder, see:
-- https://github.com/permaweb/llama-herder

-- Load the Llama Herder library
Llama = require("@sam/Llama-Herder")
Llama.getPrices()
19 changes: 19 additions & 0 deletions ai-demo/2_sample.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
OUTPUTS = OUTPUTS or {}

-- Full inference arguments:
Llama.run(
"What is the meaning of life?", -- Your prompt
20, -- Number of tokens to generate
function(generated_text) -- Optional: A function to handle the response
print(generated_text)
table.insert(OUTPUTS, generated_text)
end,
{
Fee = 100, -- Optional: The total fee in Winston you would like to pay; OR
Multiplier = 1.1 -- Optional: If not using an automatic or static fee,
-- you can set the multiplier on the last accepted fee that you would like to pay
}
)

-- Example inference message:
-- https://www.ao.link/#/message/WRIWus6LVM35ENHTNzypc8RExEVbNycX3Ku3lVhnvZQ
35 changes: 35 additions & 0 deletions ai-demo/3_prompt.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
local system = [[
<|system|>
Only tell jokes about cats
<|end|>
<|user|>
]]

local rest = [[
<|end|>
<|assistant|>
]]

local userContent = "Tell me a joke"

local prompt = system .. userContent .. rest

OUTPUTS = OUTPUTS or {}

-- Full inference arguments:
Llama.run(
prompt, -- Your prompt
20, -- Number of tokens to generate
function(generated_text) -- Optional: A function to handle the response
print(generated_text)
table.insert(OUTPUTS, generated_text)
end,
{
Fee = 100, -- Optional: The total fee in Winston you would like to pay; OR
Multiplier = 1.1 -- Optional: If not using an automatic or static fee,
-- you can set the multiplier on the last accepted fee that you would like to pay
}
)

-- Example inference message:
-- https://www.ao.link/#/message/WRIWus6LVM35ENHTNzypc8RExEVbNycX3Ku3lVhnvZQ

0 comments on commit ec5f249

Please sign in to comment.