Merge branch 'main' into feat/improve-support-local-deployment
Browse files- examples/enforce_mapgie_template copy.py +14 -0
- examples/ollama_local.py +15 -0
- examples/openai_local.py +16 -0
examples/enforce_mapgie_template copy.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# /// script
|
2 |
+
# requires-python = ">=3.11,<3.12"
|
3 |
+
# dependencies = [
|
4 |
+
# "synthetic-dataset-generator",
|
5 |
+
# ]
|
6 |
+
# ///
|
7 |
+
import os
|
8 |
+
|
9 |
+
from synthetic_dataset_generator import launch
|
10 |
+
|
11 |
+
os.environ["MAGPIE_PRE_QUERY_TEMPLATE"] = "my_custom_template"
|
12 |
+
os.environ["MODEL"] = "google/gemma-2-9b-it"
|
13 |
+
|
14 |
+
launch()
|
examples/ollama_local.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# /// script
|
2 |
+
# requires-python = ">=3.11,<3.12"
|
3 |
+
# dependencies = [
|
4 |
+
# "synthetic-dataset-generator",
|
5 |
+
# ]
|
6 |
+
# ///
|
7 |
+
import os
|
8 |
+
|
9 |
+
from synthetic_dataset_generator import launch
|
10 |
+
|
11 |
+
assert os.getenv("HF_TOKEN") # push the data to huggingface
|
12 |
+
os.environ["BASE_URL"] = "http://127.0.0.1:11434/v1/"
|
13 |
+
os.environ["MODEL"] = "llama3.1"
|
14 |
+
|
15 |
+
launch()
|
examples/openai_local.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# /// script
|
2 |
+
# requires-python = ">=3.11,<3.12"
|
3 |
+
# dependencies = [
|
4 |
+
# "synthetic-dataset-generator",
|
5 |
+
# ]
|
6 |
+
# ///
|
7 |
+
import os
|
8 |
+
|
9 |
+
from synthetic_dataset_generator import launch
|
10 |
+
|
11 |
+
assert os.getenv("HF_TOKEN") # push the data to huggingface
|
12 |
+
os.environ["BASE_URL"] = "https://api.openai.com/v1/"
|
13 |
+
os.environ["API_KEY"] = os.getenv("OPENAI_API_KEY")
|
14 |
+
os.environ["MODEL"] = "gpt-4o"
|
15 |
+
|
16 |
+
launch()
|