mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
refactor: Change model back to phi
Refs: OPS-12
This commit is contained in:
parent
aeb3875564
commit
f7a7eeb3c7
2 changed files with 10 additions and 11 deletions
|
|
@ -23,23 +23,23 @@ This is critically important: The output will be processed by a system that requ
|
||||||
EXACT compliance with these formatting rules.
|
EXACT compliance with these formatting rules.
|
||||||
Any deviation will cause technical failures.
|
Any deviation will cause technical failures.
|
||||||
|
|
||||||
Example output:
|
The poems may look like the following ones:
|
||||||
|
|
||||||
|
Example 1:
|
||||||
An old silent pond
|
An old silent pond
|
||||||
A frog jumps into the pond
|
A frog jumps into the pond
|
||||||
Splash! Silence again
|
Splash! Silence again
|
||||||
|
|
||||||
|
Example 2:
|
||||||
A world of dew
|
A world of dew
|
||||||
And within every dewdrop
|
And within every dewdrop
|
||||||
A world of struggle
|
A world of struggle
|
||||||
|
|
||||||
|
Example 3:
|
||||||
The light of a candle
|
The light of a candle
|
||||||
Is transferred to another candle
|
Is transferred to another candle
|
||||||
Spring twilight
|
Spring twilight
|
||||||
|
|
||||||
I write, erase, rewrite
|
|
||||||
Erase again, and then
|
|
||||||
A poppy blooms
|
|
||||||
|
|
||||||
You MUST use this format:
|
You MUST use this format:
|
||||||
<the first line>
|
<the first line>
|
||||||
|
|
@ -57,12 +57,12 @@ EOF
|
||||||
# Create the JSON structure with jq (install with: apt-get install jq)
|
# Create the JSON structure with jq (install with: apt-get install jq)
|
||||||
CONF=$(jq -n --arg system "$SYSTEM_PROMPT" '{
|
CONF=$(jq -n --arg system "$SYSTEM_PROMPT" '{
|
||||||
model: "haiku",
|
model: "haiku",
|
||||||
from: "llama3.2",
|
from: "phi3",
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
system: $system
|
system: $system
|
||||||
}')
|
}')
|
||||||
|
|
||||||
curl http://ollama:11434/api/pull -d '{"model": "llama3.2"}'
|
curl http://ollama:11434/api/pull -d '{"model": "phi3"}'
|
||||||
curl http://ollama:11434/api/create -d "$CONF"
|
curl http://ollama:11434/api/create -d "$CONF"
|
||||||
cd /app
|
cd /app
|
||||||
poetry run sh -c 'flask --app senju/main run --host=0.0.0.0'
|
poetry run sh -c 'flask --app senju/main run --host=0.0.0.0'
|
||||||
|
|
|
||||||
|
|
@ -39,15 +39,14 @@ class Haiku:
|
||||||
|
|
||||||
lines = ai_response.split("\n")
|
lines = ai_response.split("\n")
|
||||||
|
|
||||||
for line in lines:
|
for _ in range(0, 2):
|
||||||
if len(line.split(" ")) > 8 or line == "\n" or line == " ":
|
lines.pop()
|
||||||
lines.remove(line)
|
|
||||||
|
logging.warning(lines)
|
||||||
|
|
||||||
if len(lines) != 3:
|
if len(lines) != 3:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logging.warning(lines)
|
|
||||||
|
|
||||||
haiku = Haiku(
|
haiku = Haiku(
|
||||||
[
|
[
|
||||||
lines[0],
|
lines[0],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue