mirror of
https://github.com/wassname/prob_jsonformer.git
synced 2026-08-20 12:40:20 +08:00
Merge branch 'main' into main
This commit is contained in:
@@ -2,3 +2,4 @@ __pycache__/
|
||||
.venv
|
||||
workspace.ipynb
|
||||
dist
|
||||
.DS_Store
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Jsonformer: A Bulletproof Way to Generate Structured JSON from Language Models.
|
||||
|
||||
### Problem: Getting models to output structed JSON is hard
|
||||
### Problem: Getting models to output structured JSON is hard
|
||||
|
||||
### Solution: Only generate the content tokens and fill in the fixed tokens
|
||||
|
||||
@@ -31,7 +31,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
model = AutoModelForCausalLM.from_pretrained("databricks/dolly-v2-12b")
|
||||
tokenizer = AutoTokenizer.from_pretrained("databricks/dolly-v2-12b")
|
||||
|
||||
schema = {
|
||||
json_schema = {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
|
||||
Reference in New Issue
Block a user