mirror of
https://github.com/neuml/txtai.git
synced 2026-10-12 02:19:52 +00:00
Update documentation to use base imports, closes #765
This commit is contained in:
@@ -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
@@ -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"
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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", [
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user