Skip to content

Commit

Permalink
Merge pull request #1 from Evref-BL/add-phi3-mini
Browse files Browse the repository at this point in the history
add phi3 mini
  • Loading branch information
badetitou authored Jul 18, 2024
2 parents 414acb6 + cbda8e5 commit a8eee6e
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 10 deletions.
16 changes: 9 additions & 7 deletions src/BaselineOfPharoOllama/BaselineOfPharoOllama.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Internal Representation and Key Implementation Points.
Implementation Points
"
Class {
#name : #BaselineOfPharoOllama,
#superclass : #BaselineOf,
#category : #BaselineOfPharoOllama
#name : 'BaselineOfPharoOllama',
#superclass : 'BaselineOf',
#category : 'BaselineOfPharoOllama',
#package : 'BaselineOfPharoOllama'
}

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfPharoOllama >> baseline: spec [

<baseline>
Expand All @@ -36,22 +37,23 @@ BaselineOfPharoOllama >> baseline: spec [
self defineGroups: spec ]
]

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfPharoOllama >> defineDependencies: spec [

spec
baseline: 'NeoJSON'
with: [ spec repository: 'github://svenvc/NeoJSON/repository' ]
]

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfPharoOllama >> defineGroups: spec [
]

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfPharoOllama >> definePackages: spec [

spec package: 'Pharo-Ollama' with: [ spec requires: #( 'NeoJSON' ) ].
spec package: 'Pharo-Ollama-Tests' with: [ spec requires: #( 'Pharo-Ollama' ) ].

spec for: #'pharo10.x' do: [
spec
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfPharoOllama/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfPharoOllama }
Package { #name : 'BaselineOfPharoOllama' }
24 changes: 24 additions & 0 deletions src/Pharo-Ollama-Tests/OllamaAPITest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"
An OllamaAPITest is a test class for testing the behavior of OllamaAPI
"
Class {
#name : 'OllamaAPITest',
#superclass : 'TestCase',
#instVars : [
'ollama'
],
#category : 'Pharo-Ollama-Tests',
#package : 'Pharo-Ollama-Tests'
}

{ #category : 'running' }
OllamaAPITest >> setUp [
super setUp.
ollama := OllamaAPI new.
]

{ #category : 'running' }
OllamaAPITest >> testOllamaAPIHasDefaultModelInitialized [

self assert: (ollama model isKindOf: OModel)
]
1 change: 1 addition & 0 deletions src/Pharo-Ollama-Tests/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'Pharo-Ollama-Tests' }
9 changes: 9 additions & 0 deletions src/Pharo-Ollama/OCodeLlamaModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ OCodeLlamaModel class >> code7b [
yourself
]

{ #category : 'accessing' }
OCodeLlamaModel class >> codeLlama7binstructq3KS [

<ollamaInit: 'codellama:7b-instruct-q3_K_S'>
^ self new
tag: '7b-instruct-q3_K_S';
yourself
]

{ #category : 'accessing' }
OCodeLlamaModel class >> instruct7b [

Expand Down
30 changes: 30 additions & 0 deletions src/Pharo-Ollama/OPhi3Model.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Class {
#name : 'OPhi3Model',
#superclass : 'OModel',
#category : 'Pharo-Ollama',
#package : 'Pharo-Ollama'
}

{ #category : 'accessing' }
OPhi3Model class >> medium [

<ollamaInit: 'phi3:medium'>
^ self new
tag: 'medium';
yourself
]

{ #category : 'accessing' }
OPhi3Model class >> mini [

<ollamaInit: 'phi3:mini'>
^ self new
tag: 'mini';
yourself
]

{ #category : 'accessing' }
OPhi3Model >> name [

^ 'phi3'
]
7 changes: 5 additions & 2 deletions src/Pharo-Ollama/OllamaAPI.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ OllamaAPI class >> ollamaSettings: aBuilder [
with: [
(aBuilder pickOne: #defaultModel)
order: -100000;
label: 'HuggingFace Default model';
label: 'Ollama Default model';
target: self;
default: OCodeLlamaModel class >> #b7;
domainValues:
Expand Down Expand Up @@ -122,7 +122,10 @@ OllamaAPI >> initialize [
super initialize.
host := '127.0.0.1'.
port := 11434.
model := self class defaultModel.
model := self class defaultModel
valueWithReceiver:
self class defaultModel methodClass instanceSide
arguments: { }.
stream := false
]

Expand Down

0 comments on commit a8eee6e

Please sign in to comment.