From bee29a4e9febe2fc9285ee9e8c3e2738d9385c3d Mon Sep 17 00:00:00 2001 From: epwalsh Date: Mon, 7 Jun 2021 09:05:37 -0700 Subject: [PATCH 1/2] fix AllenNLP QA example --- interfaces/Libraries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/Libraries.ts b/interfaces/Libraries.ts index d545a55e8b..3ffaf67d38 100644 --- a/interfaces/Libraries.ts +++ b/interfaces/Libraries.ts @@ -89,7 +89,7 @@ const allennlpQuestionAnswering = (model: ModelData) => `import allennlp_models from allennlp.predictors.predictor import Predictor -predictor = Predictor.from_path("${model.modelId}") +predictor = Predictor.from_path("hf://${model.modelId}") predictor_input = {"passage": "My name is Wolfgang and I live in Berlin", "question": "Where do I live?"} predictions = predictor.predict_json(predictor_input)`; From 7bea7c7ffc4bb1de83cb4a1550ea7271572fe775 Mon Sep 17 00:00:00 2001 From: epwalsh Date: Mon, 7 Jun 2021 09:26:26 -0700 Subject: [PATCH 2/2] update AllenNLP, AllenNLP Models --- .../docker_images/allennlp/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-inference-community/docker_images/allennlp/requirements.txt b/api-inference-community/docker_images/allennlp/requirements.txt index c91fd85105..a167d6ec07 100644 --- a/api-inference-community/docker_images/allennlp/requirements.txt +++ b/api-inference-community/docker_images/allennlp/requirements.txt @@ -1,6 +1,6 @@ starlette==0.14.2 numpy==1.20.2 +allennlp>=2.5.0,<3.0.0 # Even though it is not imported, it is actually required. -allennlp_models --e git://github.com/LysandreJik/allennlp@hf_hub#egg=allennlp +allennlp_models>=2.5.0,<3.0.0 huggingface_hub==0.0.8