mirror of
https://github.com/thinking-machines-lab/tinker.git
synced 2026-04-26 17:13:11 +00:00
Sync contents
This commit is contained in:
parent
5ad4282c96
commit
e7a0d0ca2d
15 changed files with 91 additions and 31 deletions
|
|
@ -23,7 +23,7 @@ Args:
|
|||
|
||||
Example:
|
||||
```python
|
||||
sampling_client = service_client.create_sampling_client(base_model="Qwen/Qwen2.5-7B")
|
||||
sampling_client = service_client.create_sampling_client(base_model="Qwen/Qwen3-8B")
|
||||
prompt = types.ModelInput.from_ints(tokenizer.encode("The weather today is"))
|
||||
params = types.SamplingParams(max_tokens=20, temperature=0.7)
|
||||
future = sampling_client.sample(prompt=prompt, sampling_params=params, num_samples=1)
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ def create_lora_training_client(
|
|||
Create a TrainingClient for LoRA fine-tuning.
|
||||
|
||||
Args:
|
||||
- `base_model`: Name of the base model to fine-tune (e.g., "Qwen/Qwen2.5-7B")
|
||||
- `base_model`: Name of the base model to fine-tune (e.g., "Qwen/Qwen3-8B")
|
||||
- `rank`: LoRA rank controlling the size of adaptation matrices (default 32)
|
||||
- `seed`: Random seed for initialization. None means random seed.
|
||||
- `train_mlp`: Whether to train MLP layers (default True)
|
||||
|
|
@ -88,7 +88,7 @@ Returns:
|
|||
Example:
|
||||
```python
|
||||
training_client = service_client.create_lora_training_client(
|
||||
base_model="Qwen/Qwen2.5-7B",
|
||||
base_model="Qwen/Qwen3-8B",
|
||||
rank=16,
|
||||
train_mlp=True,
|
||||
train_attn=True
|
||||
|
|
@ -203,7 +203,7 @@ Create a SamplingClient for text generation.
|
|||
|
||||
Args:
|
||||
- `model_path`: Path to saved model weights (e.g., "tinker://run-id/weights/checkpoint-001")
|
||||
- `base_model`: Name of base model to use (e.g., "Qwen/Qwen2.5-7B")
|
||||
- `base_model`: Name of base model to use (e.g., "Qwen/Qwen3-8B")
|
||||
- `retry_config`: Optional configuration for retrying failed requests
|
||||
|
||||
Returns:
|
||||
|
|
@ -216,7 +216,7 @@ Example:
|
|||
```python
|
||||
# Use a base model
|
||||
sampling_client = service_client.create_sampling_client(
|
||||
base_model="Qwen/Qwen2.5-7B"
|
||||
base_model="Qwen/Qwen3-8B"
|
||||
)
|
||||
|
||||
# Or use saved weights
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Args:
|
|||
|
||||
Example:
|
||||
```python
|
||||
training_client = service_client.create_lora_training_client(base_model="Qwen/Qwen2.5-7B")
|
||||
training_client = service_client.create_lora_training_client(base_model="Qwen/Qwen3-8B")
|
||||
fwdbwd_future = training_client.forward_backward(training_data, "cross_entropy")
|
||||
optim_future = training_client.optim_step(types.AdamParams(learning_rate=1e-4))
|
||||
fwdbwd_result = fwdbwd_future.result() # Wait for gradients
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue