-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in parsing ollamar::generate with ollama>1.2.1 #1
Comments
Hmm... it's working for me when I run it today. pp <-
get_preprints(subject=c("bioinformatics", "genomics", "synthetic_biology")) |>
add_prompt() |>
add_summary(model="llama2:latest")
When I run it with this specific example, there's no issue: pp <- tibble::tibble(title="PHIStruct: Improving phage-host interaction prediction at low sequence similarity settings using structure-aware protein embeddings", abstract="Recent computational approaches for predicting phage-host interaction have explored the use of sequence-only protein language models to produce embeddings of phage proteins without manual feature engineering. However, these embeddings do not directly capture protein structure information and structure-informed signals related to host specificity. We present PHIStruct, a multilayer perceptron that takes in structure-aware embeddings of receptor-binding proteins, generated via the structure-aware protein language model SaProt, and then predicts the host from among the ESKAPEE genera. Compared against recent tools, PHIStruct exhibits the best balance of precision and recall, with the highest and most stable F1 score across a wide range of confidence thresholds and sequence similarity settings. The margin in performance is most pronounced when the sequence similarity between the training and test sets drops below 40%, wherein, at a relatively high-confidence threshold of above 50%, PHIStruct presents a 7% to 9% increase in class-averaged F1 over machine learning tools that do not directly incorporate structure information, as well as a 5% to 6% increase over BLASTp. The data and source code for our experiments and analyses are available at https://github.com/bioinfodlsu/PHIStruct.")
pp <- pp |> add_prompt() |> add_summary()
pp$summary
pp$prompt
Let's see what happens with this prompt: theprompt <- pp$prompt
modelres <- ollamar::generate(model="llama2:latest", prompt = theprompt, output="text")
class(modelres)
|
Ok, nevermind, I see the same thing when I upgrade to ollamar 1.2.1. I think the fix is easy here. |
stephenturner
changed the title
Error in parsing ollamar::generate
Error in parsing ollamar::generate with ollama>1.2.1
Aug 25, 2024
Thank you for the fix. It worked after reinstalling. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank for developing a very helpful package. I got the following error when trying to run
pp <-
get_preprints(subject=c("bioinformatics", "genomics", "synthetic_biology")) |>
add_prompt() |>
add_summary(model="llama2:latest")
Error in
dplyr::mutate()
:ℹ In argument:
summary = as.vector(...)
.Caused by error in
ollamar::generate(model = model, prompt = x, output = "text")$response
:! $ operator is invalid for atomic vectors
Run
rlang::last_trace()
to see where the error occurred.When I run the str(ollamar::generate(model = "llama2:latest",
prompt = "I am giving you a paper's title and abstract. Summarize the paper in as many sentences as I instruct. Do not include any preamble text to the summary just give me the summary with no preface or intro sentence.\nNumber of sentences in summary: 2\nTitle: PHIStruct: Improving phage-host interaction prediction at low sequence similarity settings using structure-aware protein embeddings\nAbstract: Recent computational approaches for predicting phage-host interaction have explored the use of sequence-only protein language models to produce embeddings of phage proteins without manual feature engineering. However, these embeddings do not directly capture protein structure information and structure-informed signals related to host specificity. We present PHIStruct, a multilayer perceptron that takes in structure-aware embeddings of receptor-binding proteins, generated via the structure-aware protein language model SaProt, and then predicts the host from among the ESKAPEE genera. Compared against recent tools, PHIStruct exhibits the best balance of precision and recall, with the highest and most stable F1 score across a wide range of confidence thresholds and sequence similarity settings. The margin in performance is most pronounced when the sequence similarity between the training and test sets drops below 40%, wherein, at a relatively high-confidence threshold of above 50%, PHIStruct presents a 7% to 9% increase in class-averaged F1 over machine learning tools that do not directly incorporate structure information, as well as a 5% to 6% increase over BLASTp. The data and source code for our experiments and analyses are available at https://github.com/bioinfodlsu/PHIStruct.",
output = "text"))
I got a character vector returned.
chr "Sure, here is a summary of the paper "PHIStruct: Improving phage-host interaction prediction at low sequence s"| truncated
I believe the error is due to the return value from ollamar::generate is not a list.
sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)
Matrix products: default
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ollamar_1.2.1.9000 biorecap_0.1.0
loaded via a namespace (and not attached):
[1] jsonlite_1.8.8 dplyr_1.1.4 compiler_4.3.1 crayon_1.5.3 Rcpp_1.0.13 tidyselect_1.2.1
[7] xml2_1.3.6 callr_3.7.6 jquerylib_0.1.4 yaml_2.3.10 fastmap_1.2.0 R6_2.5.1
[13] generics_0.1.3 curl_5.0.2 httr2_1.0.3 knitr_1.48 tibble_3.2.1 desc_1.4.3
[19] bslib_0.8.0 pillar_1.9.0 rlang_1.1.4 utf8_1.2.4 cachem_1.1.0 xfun_0.47
[25] sass_0.4.9 cli_3.6.3 withr_3.0.1 magrittr_2.0.3 ps_1.7.7 digest_0.6.37
[31] processx_3.8.4 rstudioapi_0.15.0 remotes_2.4.2.1 rappdirs_0.3.3 anytime_0.3.9 lifecycle_1.0.4
[37] tidyRSS_2.0.7 vctrs_0.6.5 evaluate_0.24.0 glue_1.7.0 pkgbuild_1.4.4 fansi_1.0.6
[43] purrr_1.0.2 httr_1.4.7 rmarkdown_2.28 tools_4.3.1 pkgconfig_2.0.3 htmltools_0.5.8.1
The text was updated successfully, but these errors were encountered: