File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import DataFrame.Operations.Core (columnNames, nRows)
2222import DataFrame.Operations.Statistics (percentile )
2323import DataFrame.Operations.Subset (exclude , filterWhere )
2424
25- import Control.Exception (throw )
25+ import Control.Exception (SomeException , throw , try )
2626import Control.Monad (guard )
2727import Data.Containers.ListUtils (nubOrd )
2828import Data.Function (on )
@@ -224,10 +224,14 @@ score expr =
224224 , prompt = T. pack (instructions ++ prettyPrint expr)
225225 }
226226 llamaConfig = Just (defaultOllamaConfig{hostUrl = " http://127.0.0.1:8080" })
227- llmResponse = genResponse $ either throw id $ unsafePerformIO (generate genOp llamaConfig)
228- s = fst $ either error id $ decimal @ Int $ llmResponse
227+ result = unsafePerformIO $ try @ SomeException (generate genOp llamaConfig)
229228 in
230- trace (prettyPrint expr ++ " : " ++ show s) s
229+ case result of
230+ Right (Right response) ->
231+ let llmResponse = genResponse response
232+ s = fst $ either error id $ decimal @ Int llmResponse
233+ in trace (prettyPrint expr ++ " : " ++ show s) s
234+ _ -> 7
231235
232236numericExprs ::
233237 SynthConfig -> DataFrame -> [Expr Double ] -> Int -> Int -> [Expr Double ]
You can’t perform that action at this time.
0 commit comments