mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-08-22 15:38:01 +00:00
Revert "Make the docstring bot work only on master" (#2114)
* Revert "Make the docstring bot work only on master (#2078)" This reverts commit 649d07405770cd59696d0120107a3b2f0aafe7c2. * Add latest docstring and tutorial changes Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
3c768071d5
commit
009c89fc53
@ -3,10 +3,10 @@ name: Update Docstrings and Tutorials
|
|||||||
# Controls when the action will run. Triggers the workflow on push
|
# Controls when the action will run. Triggers the workflow on push
|
||||||
# events but only for the master branch
|
# events but only for the master branch
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches-ignore:
|
||||||
- master
|
- master
|
||||||
|
- benchmarks
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# This workflow contains a single job called "build"
|
# This workflow contains a single job called "build"
|
||||||
|
@ -32,7 +32,7 @@ Make sure you enable the GPU runtime to experience decent speed in this tutorial
|
|||||||
|
|
||||||
# Install the latest master of Haystack
|
# Install the latest master of Haystack
|
||||||
!pip install --upgrade pip
|
!pip install --upgrade pip
|
||||||
!pip install git+https://github.com/deepset-ai/haystack.git#egg=farm-haystack[colab]
|
!pip install git+https://github.com/deepset-ai/haystack.git#egg=farm-haystack[colab,faiss]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,27 +170,6 @@ These are used to condition the generator as it generates the answer.
|
|||||||
What it should return then are novel text spans that form and answer to your question!
|
What it should return then are novel text spans that form and answer to your question!
|
||||||
|
|
||||||
|
|
||||||
```python
|
|
||||||
# Now generate an answer for each question
|
|
||||||
for question in QUESTIONS:
|
|
||||||
# Retrieve related documents from retriever
|
|
||||||
retriever_results = retriever.retrieve(
|
|
||||||
query=question
|
|
||||||
)
|
|
||||||
|
|
||||||
# Now generate answer from question and retrieved documents
|
|
||||||
predicted_result = generator.predict(
|
|
||||||
query=question,
|
|
||||||
documents=retriever_results,
|
|
||||||
top_k=1
|
|
||||||
)
|
|
||||||
|
|
||||||
# Print you answer
|
|
||||||
answers = predicted_result["answers"]
|
|
||||||
print(f'Generated answer is \'{answers[0].answer}\' for the question = \'{question}\'')
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# Or alternatively use the Pipeline class
|
# Or alternatively use the Pipeline class
|
||||||
from haystack.pipelines import GenerativeQAPipeline
|
from haystack.pipelines import GenerativeQAPipeline
|
||||||
|
Loading…
x
Reference in New Issue
Block a user