Skip to content

Commit 749cd30

Browse files
feat(api): api update
1 parent eb70281 commit 749cd30

File tree

5 files changed

+57
-31
lines changed

5 files changed

+57
-31
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 35
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-6a22514b4135fd95c089056c58f3bbfa0690b948fcebaff46cd7f8059ce197af.yml
3-
openapi_spec_hash: 44185aa5883e5c4ca09c86bc12f5fd18
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-f95d7f3aa4164abb82f5ba3a1ccc44105e9ce85c5d2bb8f0ac58f8ef18ffc254.yml
3+
openapi_spec_hash: 0b0cac750868ea6ba74b338888169518
44
config_hash: 2887483246d24a361689cbd1258db7cf

src/resources/audio/transcriptions.ts

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ export class Transcriptions extends APIResource {
1414
* ```ts
1515
* const transcription =
1616
* await client.audio.transcriptions.create({
17-
* file: {
18-
* data: fs.createReadStream('path/to/file'),
19-
* type: 'binary',
20-
* },
17+
* file: fs.createReadStream('path/to/file'),
2118
* });
2219
* ```
2320
*/
@@ -117,10 +114,9 @@ export namespace TranscriptionCreateResponse {
117114

118115
export interface TranscriptionCreateParams {
119116
/**
120-
* Audio file upload or public HTTP/HTTPS URL. Supported formats .wav, .mp3, .m4a,
121-
* .webm, .flac.
117+
* Audio file to transcribe
122118
*/
123-
file: TranscriptionCreateParams.Binary | TranscriptionCreateParams.URL;
119+
file: Uploadable;
124120

125121
/**
126122
* Optional ISO 639-1 language code. If `auto` is provided, language is
@@ -156,26 +152,6 @@ export interface TranscriptionCreateParams {
156152
timestamp_granularities?: 'segment' | 'word' | Array<'segment' | 'word'>;
157153
}
158154

159-
export namespace TranscriptionCreateParams {
160-
export interface Binary {
161-
/**
162-
* Audio file to transcribe
163-
*/
164-
data: Uploadable;
165-
166-
type: 'binary';
167-
}
168-
169-
export interface URL {
170-
type: 'url';
171-
172-
/**
173-
* Public HTTPS URL to audio file
174-
*/
175-
url: string;
176-
}
177-
}
178-
179155
export declare namespace Transcriptions {
180156
export {
181157
type TranscriptionCreateResponse as TranscriptionCreateResponse,

src/resources/fine-tune.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ export interface FineTune {
139139

140140
from_checkpoint?: string;
141141

142+
from_hf_model?: string;
143+
144+
hf_model_revision?: string;
145+
142146
job_id?: string;
143147

144148
learning_rate?: number;
@@ -346,6 +350,16 @@ export interface FineTuneCreateResponse {
346350
*/
347351
from_checkpoint?: string;
348352

353+
/**
354+
* Hugging Face Hub repo to start training from
355+
*/
356+
from_hf_model?: string;
357+
358+
/**
359+
* The revision of the Hugging Face Hub model to continue training from
360+
*/
361+
hf_model_revision?: string;
362+
349363
/**
350364
* Learning rate used for training
351365
*/
@@ -500,6 +514,16 @@ export namespace FineTuneListResponse {
500514
*/
501515
from_checkpoint?: string;
502516

517+
/**
518+
* Hugging Face Hub repo to start training from
519+
*/
520+
from_hf_model?: string;
521+
522+
/**
523+
* The revision of the Hugging Face Hub model to continue training from
524+
*/
525+
hf_model_revision?: string;
526+
503527
/**
504528
* Learning rate used for training
505529
*/
@@ -650,6 +674,16 @@ export interface FineTuneCancelResponse {
650674
*/
651675
from_checkpoint?: string;
652676

677+
/**
678+
* Hugging Face Hub repo to start training from
679+
*/
680+
from_hf_model?: string;
681+
682+
/**
683+
* The revision of the Hugging Face Hub model to continue training from
684+
*/
685+
hf_model_revision?: string;
686+
653687
/**
654688
* Learning rate used for training
655689
*/
@@ -811,11 +845,25 @@ export interface FineTuneCreateParams {
811845
*/
812846
from_checkpoint?: string;
813847

848+
/**
849+
* The Hugging Face Hub repo to start training from. Should be as close as possible
850+
* to the base model (specified by the `model` argument) in terms of architecture
851+
* and size.
852+
*/
853+
from_hf_model?: string;
854+
814855
/**
815856
* The API token for the Hugging Face Hub.
816857
*/
817858
hf_api_token?: string;
818859

860+
/**
861+
* The revision of the Hugging Face Hub model to continue training from. E.g.,
862+
* hf_model_revision=main (default, used if the argument is not provided) or
863+
* hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' (specific commit).
864+
*/
865+
hf_model_revision?: string;
866+
819867
/**
820868
* The name of the Hugging Face repository to upload the fine-tuned model to.
821869
*/

tests/api-resources/audio/transcriptions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Together({
1010
describe('resource transcriptions', () => {
1111
test('create: only required params', async () => {
1212
const responsePromise = client.audio.transcriptions.create({
13-
file: { data: await toFile(Buffer.from('# my file contents'), 'README.md'), type: 'binary' },
13+
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
1414
});
1515
const rawResponse = await responsePromise.asResponse();
1616
expect(rawResponse).toBeInstanceOf(Response);
@@ -23,7 +23,7 @@ describe('resource transcriptions', () => {
2323

2424
test('create: required and optional params', async () => {
2525
const response = await client.audio.transcriptions.create({
26-
file: { data: await toFile(Buffer.from('# my file contents'), 'README.md'), type: 'binary' },
26+
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
2727
language: 'en',
2828
model: 'openai/whisper-large-v3',
2929
prompt: 'prompt',

tests/api-resources/fine-tune.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ describe('resource fineTune', () => {
2525
training_file: 'training_file',
2626
batch_size: 0,
2727
from_checkpoint: 'from_checkpoint',
28+
from_hf_model: 'from_hf_model',
2829
hf_api_token: 'hf_api_token',
30+
hf_model_revision: 'hf_model_revision',
2931
hf_output_repo_name: 'hf_output_repo_name',
3032
learning_rate: 0,
3133
lr_scheduler: { lr_scheduler_type: 'linear', lr_scheduler_args: { min_lr_ratio: 0 } },

0 commit comments

Comments
 (0)