Skip to content

Commit

Permalink
Merge branch 'main' into fix/prompt-removal-from-output-sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
venondev authored Dec 15, 2023
2 parents edd83e5 + 57e5cd3 commit 314e57b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ You can reduce the completion to a choice between multiple possibilities:
``` python
import outlines

model = outlines.models.transformers("mistralai/Mistral-7B")
model = outlines.models.transformers("mistralai/Mistral-7B-v0.1")

prompt = """You are a sentiment-labelling assistant.
Is the following review positive or negative?
Expand All @@ -111,7 +111,7 @@ You can instruct the model to only return integers or floats:
``` python
import outlines

model = outlines.models.transformers("mistralai/Mistral-7B")
model = outlines.models.transformers("mistralai/Mistral-7B-v0.1")

prompt = "1+1="
answer = outlines.generate.format(model, int)(prompt)
Expand All @@ -129,7 +129,7 @@ hood:
``` python
import outlines

model = outlines.models.transformers("mistralai/Mistral-7B")
model = outlines.models.transformers("mistralai/Mistral-7B-v0.1")

prompt = "Is 1+1=2? "
unguided = outlines.generate.continuation(model, max_tokens=30)(prompt)
Expand All @@ -151,7 +151,7 @@ print(guided)
``` python
import outlines

model = outlines.models.transformers("mistralai/Mistral-7B")
model = outlines.models.transformers("mistralai/Mistral-7B-v0.1")

prompt = "What is the IP address of the Google DNS servers? "
unguided = generate.continuation(model, max_tokens=30)(prompt)
Expand Down Expand Up @@ -211,7 +211,7 @@ class Character(BaseModel):
strength: int


model = outlines.models.transformers("mistralai/Mistral-7B", device="cuda")
model = outlines.models.transformers("mistralai/Mistral-7B-v0.1", device="cuda")

# Construct guided sequence generator
generator = outlines.generate.json(model, Character, max_tokens=100)
Expand Down Expand Up @@ -254,7 +254,7 @@ import outlines
def add(a: int, b: int):
return a + b

model = outlines.models.transformers("mistralai/Mistral-7B")
model = outlines.models.transformers("mistralai/Mistral-7B-v0.1")
generator = outlines.generate.json(model, add)
result = generator("Return two integers named a and b respectively. a is odd and b even.")

Expand Down Expand Up @@ -298,7 +298,7 @@ def labelling(to_label, examples):
{{ to_label }} //
"""

model = outlines.models.transformers("mistralai/Mistral-7B")
model = outlines.models.transformers("mistralai/Mistral-7B-v0.1")
prompt = labelling("Just awesome", examples)
answer = outlines.generate.continuation(model, max_tokens=100)(prompt)
```
Expand Down

0 comments on commit 314e57b

Please sign in to comment.