Skip to content

Commit 26067fd

Browse files
fix: pre-commit formatting
1 parent fe1ff88 commit 26067fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2976
-2964
lines changed

.github/stochastic_logo_dark.svg

Lines changed: 1044 additions & 1044 deletions
Loading

.github/stochastic_logo_light.svg

Lines changed: 1125 additions & 1125 deletions
Loading

docs/docs/advanced/advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ import DocCardList from '@theme/DocCardList';
99

1010
# 🧗🏻 Advanced Topics
1111

12-
<DocCardList />
12+
<DocCardList />

docs/docs/advanced/api_server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ Ensure that the model path you provide is a directory containing a valid xturing
7575
}
7676
```
7777

78-
By following these steps, you can effectively run your fine-tuned model for text generation through the FastAPI server, facilitating seamless inference with structured requests and responses.
78+
By following these steps, you can effectively run your fine-tuned model for text generation through the FastAPI server, facilitating seamless inference with structured requests and responses.

docs/docs/advanced/generate.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ To generate a dataset we will make use of **engines** that consist of third part
1616

1717
OpenAI api key can be obtained [here](https://beta.openai.com/account/api-keys)
1818

19-
19+
2020
```python
2121
from xturing.model_apis.openai import ChatGPT, Davinci
2222
engine = ChatGPT("your-api-key")
2323
# or
2424
engine = Davinci("your-api-key")
2525
```
26-
26+
2727
</TabItem>
28-
28+
2929
<TabItem value="cohere" label="Cohere">
3030

3131
```python
@@ -75,7 +75,7 @@ Each line of this file needs to be a _JSON_ object with the following fields:
7575
| __instances__ | List[Dict[str,str]] | A list of input-output pairs that provide examples of what the model should output for this task. Each input-output pair is an object with two fields: __input__ and __output__. |
7676
| __is_classification__ | boolean | A flag that indicates whether this is a classification task or not. If this flag is set to true, the output should be a single label (e.g. a category or class), otherwise the output can be any text. The default value is false. |
7777

78-
Here's an example of a task in the above mentioned format:
78+
Here's an example of a task in the above mentioned format:
7979

8080
```json
8181
{
@@ -100,16 +100,16 @@ Here is how an sample `tasks.jsonl` file should like:
100100

101101
```json
102102
{
103-
"id": "seed_task_0",
104-
"name": "breakfast_suggestion",
105-
"instruction": "Is there anything I can eat for a breakfast that doesn't include eggs, yet includes protein, and has roughly 700-1000 calories?",
106-
"instances": [{"input": "", "output": "Yes, you can have 1 oatmeal banana protein shake and 4 strips of bacon. The oatmeal banana protein shake may contain 1/2 cup oatmeal, 60 grams whey protein powder, 1/2 medium banana, 1tbsp flaxseed oil and 1/2 cup watter, totalling about 550 calories. The 4 strips of bacon contains about 200 calories."}],
103+
"id": "seed_task_0",
104+
"name": "breakfast_suggestion",
105+
"instruction": "Is there anything I can eat for a breakfast that doesn't include eggs, yet includes protein, and has roughly 700-1000 calories?",
106+
"instances": [{"input": "", "output": "Yes, you can have 1 oatmeal banana protein shake and 4 strips of bacon. The oatmeal banana protein shake may contain 1/2 cup oatmeal, 60 grams whey protein powder, 1/2 medium banana, 1tbsp flaxseed oil and 1/2 cup watter, totalling about 550 calories. The 4 strips of bacon contains about 200 calories."}],
107107
"is_classification": false
108108
}
109109
{
110-
"id": "seed_task_1",
111-
"name": "antonym_relation",
112-
"instruction": "What is the relation between the given pairs?",
110+
"id": "seed_task_1",
111+
"name": "antonym_relation",
112+
"instruction": "What is the relation between the given pairs?",
113113
"instances": [{"input": "Night : Day :: Right : Left", "output": "The relation between the given pairs is that they are opposites."}], "is_classification": false
114114
}
115115
```
@@ -129,7 +129,7 @@ from xturing.model_apis.openai import Davinci
129129
## Load the required engine
130130
engine = Davinci("your-api-key")
131131

132-
## Generate the dataset
132+
## Generate the dataset
133133
dataset = InstructionDataset.generate_dataset(path="./tasks.jsonl", engine=engine)
134134

135135
## Save the dataset instance
@@ -162,7 +162,7 @@ A cap on the size of the dataset, this can help to create a more diverse dataset
162162

163163
## From custom data
164164

165-
We can also generate a dataset from our own files.
165+
We can also generate a dataset from our own files.
166166

167167
<details>
168168
<summary>
@@ -264,4 +264,3 @@ The number of samples that will be generated for each chunk. The default value i
264264

265265

266266
<!-- --- -->
267-

docs/docs/configuration/fine_tune_code.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const modelList = {
1515
cerebras: 'Cerebras',
1616
distilgpt2: 'DistilGPT-2',
1717
galactica: 'Galactica',
18-
gptj: 'GPT-J',
18+
gptj: 'GPT-J',
1919
gpt2: 'GPT-2',
2020
llama: 'LLaMA',
2121
llama2: 'LLaMA 2',
@@ -35,7 +35,7 @@ export default function FinetuneCode(
3535
} else {
3636
finalKey = `${code.model}_${code.technique}`
3737
}
38-
38+
3939
useEffect(() => {
4040
setCode({
4141
model: 'llama',
@@ -87,8 +87,8 @@ export default function FinetuneCode(
8787
from xturing.datasets import InstructionDataset
8888
8989
instruction_dataset = InstructionDataset("...")
90-
model = BaseModel.create("${finalKey}")`}
90+
model = BaseModel.create("${finalKey}")`}
9191
/>
9292
</div>
9393
)
94-
}
94+
}

docs/docs/configuration/finetune_configure.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For advanced usage, you can customize the `finetuning_config` attribute of the m
1515
In this tutorial, we will be loading one of the [supported models](/overview/supported_models) and customizing it's fine-tune configuration before calibrating the model to the desired dataset.
1616

1717
### Load the model and the dataset
18-
First, we need to load the model and the dataset we want to use.
18+
First, we need to load the model and the dataset we want to use.
1919

2020
<FinetuneCode />
2121

@@ -31,7 +31,7 @@ finetuning_config = model.finetuning_config()
3131
Print the `finetuning_config` object to check the default configuration.
3232

3333
### Customize the configuration
34-
Now, we can customize the generation configuration as we wish. All the customizable parameters are list [below](#parameters).
34+
Now, we can customize the generation configuration as we wish. All the customizable parameters are list [below](#parameters).
3535

3636
```python
3737
finetuning_config.batch_size = 64
@@ -98,4 +98,3 @@ max_grad_norm: 2.0
9898
save_total_limit: 4
9999
optimizer_name: adamw
100100
output_dir: saved_model -->
101-

docs/docs/configuration/inference_code.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const modelList = {
1414
cerebras: 'Cerebras',
1515
distilgpt2: 'DistilGPT-2',
1616
galactica: 'Galactica',
17-
gptj: 'GPT-J',
17+
gptj: 'GPT-J',
1818
gpt2: 'GPT-2',
1919
llama: 'LLaMA',
2020
llama2: 'LLaMA 2',
@@ -34,7 +34,7 @@ export default function InferenceCode(
3434
} else {
3535
finalKey = `${code.model}_${code.technique}`
3636
}
37-
37+
3838
useEffect(() => {
3939
setCode({
4040
model: 'llama',
@@ -83,8 +83,8 @@ export default function InferenceCode(
8383
showLineNumbers={false}
8484
language='python'
8585
children={`from xturing.models import BaseModel
86-
model = BaseModel.create("${finalKey}")`}
86+
model = BaseModel.create("${finalKey}")`}
8787
/>
8888
</div>
8989
)
90-
}
90+
}

docs/docs/configuration/inference_configure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ We can print the `generation_config` object to check the default configuration.
3333

3434
### Customize the configuration
3535

36-
Now, we can customize the generation configuration as we wish. All the customizable parameters are list [below](#parameters).
36+
Now, we can customize the generation configuration as we wish. All the customizable parameters are list [below](#parameters).
3737

3838
```python
3939
generation_config.max_new_tokens = 256

docs/docs/contributing/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"label": "🤝 Contributing",
33
"position": 4,
4-
"link": {
4+
"link": {
55
"type": "doc",
66
"id": "contributing"
77
},

0 commit comments

Comments
 (0)