Update documentation to use base imports, closes #765

This commit is contained in:
davidmezzetti
2024-08-16 09:54:15 -04:00
parent 2a064ca2db
commit 6e7ddcfc03
19 changed files with 24 additions and 25 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ The following describes available embeddings configuration. These parameters are
Configuration is designed to be optional and set only when needed. Out of the box, sensible defaults are picked to get up and running fast. For example:
```python
from txtai.embeddings import Embeddings
from txtai import Embeddings
embeddings = Embeddings()
```
@@ -13,7 +13,7 @@ embeddings = Embeddings()
Creates a new embeddings instance, using [all-MiniLM-L6-v2](https://hf.co/sentence-transformers/all-MiniLM-L6-v2) as the vector model, [Faiss](https://faiss.ai/) as the ANN index backend and content disabled.
```python
from txtai.embeddings import Embeddings
from txtai import Embeddings
embeddings = Embeddings(content=True)
```
+2 -2
View File
@@ -48,7 +48,7 @@ Embeddings example.
```python
from transformers import AutoModel, AutoTokenizer
from txtai.embeddings import Embeddings
from txtai import Embeddings
# Load model externally
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
@@ -64,7 +64,7 @@ LLM pipeline example.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from txtai.pipeline import LLM
from txtai import LLM
# Load Mistral-7B-OpenOrca
path = "Open-Orca/Mistral-7B-OpenOrca"
+1 -1
View File
@@ -47,7 +47,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -42,7 +42,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -37,7 +37,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -45,7 +45,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -50,7 +50,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -42,7 +42,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -42,7 +42,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -42,7 +42,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -43,7 +43,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -46,7 +46,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -123,7 +123,7 @@ llm:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+2 -3
View File
@@ -12,8 +12,7 @@ The data store can be an embeddings database or a similarity instance with assoc
The following shows a simple example using this pipeline.
```python
from txtai import Embeddings
from txtai import RAG
from txtai import Embeddings, RAG
# Input data
data = [
@@ -98,7 +97,7 @@ workflow:
Built in tasks make using the extractor pipeline easier.
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -43,7 +43,7 @@ similarity:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -42,7 +42,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+1 -1
View File
@@ -43,7 +43,7 @@ workflow:
### Run with Workflows
```python
from txtai.app import Application
from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
+3 -3
View File
@@ -38,7 +38,7 @@ Workflows are run with Python or configuration. Examples of both methods are sho
A full-featured example is shown below in Python. This workflow transcribes a set of audio files, translates the text into French and indexes the data.
```python
from txtai.embeddings import Embeddings
from txtai import Embeddings
from txtai.pipeline import Transcription, Translation
from txtai.workflow import FileTask, Task, Workflow
@@ -108,7 +108,7 @@ workflow:
```python
# Create and run the workflow
from txtai.app import Application
from txtai import Application
# Create and run the workflow
app = Application("workflow.yml")
@@ -153,7 +153,7 @@ workflow:
```
```python
from txtai.app import Application
from txtai import Application
app = Application("workflow.yml")
list(app.workflow("llm", [
+1 -1
View File
@@ -52,7 +52,7 @@ workflow:
```python
# Create and run the workflow
from txtai.app import Application
from txtai import Application
# Create and run the workflow
app = Application("workflow.yml")