Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 9faeb51

Browse files
committed
Fixing API functions exposition
1 parent dd73ec8 commit 9faeb51

File tree

2 files changed

+29
-55
lines changed

2 files changed

+29
-55
lines changed

native_client/deepspeech.cc

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -262,20 +262,6 @@ StreamingState::processBatch(const vector<float>& buf, unsigned int n_steps)
262262
num_classes);
263263
}
264264

265-
int
266-
DS_CreateModel(const char* aModelPath,
267-
ModelState** retval)
268-
{
269-
return DS_CreateModel_(aModelPath, false, retval);
270-
}
271-
272-
int
273-
DS_CreateModelFromBuffer(const std::string &aModelBuffer,
274-
ModelState** retval)
275-
{
276-
return DS_CreateModel_(aModelBuffer, true, retval);
277-
}
278-
279265
int
280266
DS_CreateModel_(const std::string &aModelString,
281267
bool init_from_bytes,
@@ -319,6 +305,21 @@ DS_CreateModel_(const std::string &aModelString,
319305
return DS_ERR_OK;
320306
}
321307

308+
int
309+
DS_CreateModel(const char* aModelPath,
310+
ModelState** retval)
311+
{
312+
return DS_CreateModel_(aModelPath, false, retval);
313+
}
314+
315+
int
316+
DS_CreateModelFromBuffer(const std::string &aModelBuffer,
317+
ModelState** retval)
318+
{
319+
return DS_CreateModel_(aModelBuffer, true, retval);
320+
}
321+
322+
322323
unsigned int
323324
DS_GetModelBeamWidth(const ModelState* aCtx)
324325
{
@@ -344,20 +345,6 @@ DS_FreeModel(ModelState* ctx)
344345
delete ctx;
345346
}
346347

347-
int
348-
DS_EnableExternalScorer(ModelState* aCtx,
349-
const char* aScorerPath)
350-
{
351-
return DS_EnableExternalScorer_(aCtx, aScorerPath, false);
352-
}
353-
354-
int
355-
DS_EnableExternalScorerFromBuffer(ModelState* aCtx,
356-
const std::string &aScorerBuffer)
357-
{
358-
return DS_EnableExternalScorer_(aCtx, aScorerBuffer, true);
359-
}
360-
361348
int
362349
DS_EnableExternalScorer_(ModelState* aCtx,
363350
const std::string &aScorerString,
@@ -374,6 +361,20 @@ DS_EnableExternalScorer_(ModelState* aCtx,
374361
return DS_ERR_OK;
375362
}
376363

364+
int
365+
DS_EnableExternalScorer(ModelState* aCtx,
366+
const char* aScorerPath)
367+
{
368+
return DS_EnableExternalScorer_(aCtx, aScorerPath, false);
369+
}
370+
371+
int
372+
DS_EnableExternalScorerFromBuffer(ModelState* aCtx,
373+
const std::string &aScorerBuffer)
374+
{
375+
return DS_EnableExternalScorer_(aCtx, aScorerBuffer, true);
376+
}
377+
377378
int
378379
DS_AddHotWord(ModelState* aCtx,
379380
const char* word,

native_client/deepspeech.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,6 @@ int DS_CreateModelFromBuffer(const std::string &aModelBuffer,
122122
ModelState** retval);
123123

124124

125-
/**
126-
* @brief An object providing an interface to a trained DeepSpeech model.
127-
*
128-
* @param aModelString The path/string for initializing the model graph.
129-
* @param init_from_bytes Wheter the model will be initialized using path or array of bytes.
130-
* @param[out] retval a ModelState pointer
131-
*
132-
* @return Zero on success, non-zero on failure.
133-
*/
134-
DEEPSPEECH_EXPORT
135-
int DS_CreateModel_(const std::string &aModelString,
136-
bool init_from_bytes,
137-
ModelState** retval);
138-
139125
/**
140126
* @brief Get beam width value used by the model. If {@link DS_SetModelBeamWidth}
141127
* was not called before, will return the default value loaded from the
@@ -201,19 +187,6 @@ DEEPSPEECH_EXPORT
201187
int DS_EnableExternalScorerFromBuffer(ModelState* aCtx,
202188
const std::string &aScorerBuffer);
203189

204-
/**
205-
* @brief Enable decoding using an external scorer.
206-
*
207-
* @param aCtx The ModelState pointer for the model being changed.
208-
* @param aScorerString The path/array_of_bytes to initialize the external scorer.
209-
* @param init_from_bytes Wheter the scorer will be initialized by file or array of bytes.
210-
*
211-
* @return Zero on success, non-zero on failure (invalid arguments).
212-
*/
213-
DEEPSPEECH_EXPORT
214-
int DS_EnableExternalScorer_(ModelState* aCtx,
215-
const std::string &aScorerString,
216-
bool init_from_bytes);
217190

218191
/**
219192
* @brief Add a hot-word and its boost.

0 commit comments

Comments
 (0)