@@ -9,7 +9,7 @@ const snippetImportInferenceClient = (model: ModelDataMinimal, accessToken: stri
99client = InferenceClient("${ model . id } ", token="${ accessToken || "{API_TOKEN}" } ")
1010` ;
1111
12- export const snippetConversational = (
12+ const snippetConversational = (
1313 model : ModelDataMinimal ,
1414 accessToken : string ,
1515 opts ?: {
@@ -118,7 +118,7 @@ print(completion.choices[0].message)`,
118118 }
119119} ;
120120
121- export const snippetZeroShotClassification = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
121+ const snippetZeroShotClassification = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
122122 content : `def query(payload):
123123 response = requests.post(API_URL, headers=headers, json=payload)
124124 return response.json()
@@ -129,7 +129,7 @@ output = query({
129129})` ,
130130} ) ;
131131
132- export const snippetZeroShotImageClassification = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
132+ const snippetZeroShotImageClassification = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
133133 content : `def query(data):
134134 with open(data["image_path"], "rb") as f:
135135 img = f.read()
@@ -146,7 +146,7 @@ output = query({
146146})` ,
147147} ) ;
148148
149- export const snippetBasic = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
149+ const snippetBasic = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
150150 content : `def query(payload):
151151 response = requests.post(API_URL, headers=headers, json=payload)
152152 return response.json()
@@ -156,7 +156,7 @@ output = query({
156156})` ,
157157} ) ;
158158
159- export const snippetFile = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
159+ const snippetFile = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
160160 content : `def query(filename):
161161 with open(filename, "rb") as f:
162162 data = f.read()
@@ -166,7 +166,7 @@ export const snippetFile = (model: ModelDataMinimal): InferenceSnippet => ({
166166output = query(${ getModelInputSnippet ( model ) } )` ,
167167} ) ;
168168
169- export const snippetTextToImage = ( model : ModelDataMinimal , accessToken : string ) : InferenceSnippet [ ] => [
169+ const snippetTextToImage = ( model : ModelDataMinimal , accessToken : string ) : InferenceSnippet [ ] => [
170170 {
171171 client : "huggingface_hub" ,
172172 content : `${ snippetImportInferenceClient ( model , accessToken ) }
@@ -189,7 +189,7 @@ image = Image.open(io.BytesIO(image_bytes))`,
189189 } ,
190190] ;
191191
192- export const snippetTabular = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
192+ const snippetTabular = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
193193 content : `def query(payload):
194194 response = requests.post(API_URL, headers=headers, json=payload)
195195 return response.content
@@ -198,7 +198,7 @@ response = query({
198198})` ,
199199} ) ;
200200
201- export const snippetTextToAudio = ( model : ModelDataMinimal ) : InferenceSnippet => {
201+ const snippetTextToAudio = ( model : ModelDataMinimal ) : InferenceSnippet => {
202202 // Transformers TTS pipeline and api-inference-community (AIC) pipeline outputs are diverged
203203 // with the latest update to inference-api (IA).
204204 // Transformers IA returns a byte object (wav file), whereas AIC returns wav and sampling_rate.
@@ -231,7 +231,7 @@ Audio(audio, rate=sampling_rate)`,
231231 }
232232} ;
233233
234- export const snippetDocumentQuestionAnswering = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
234+ const snippetDocumentQuestionAnswering = ( model : ModelDataMinimal ) : InferenceSnippet => ( {
235235 content : `def query(payload):
236236 with open(payload["image"], "rb") as f:
237237 img = f.read()
@@ -244,7 +244,7 @@ output = query({
244244})` ,
245245} ) ;
246246
247- export const pythonSnippets : Partial <
247+ const pythonSnippets : Partial <
248248 Record <
249249 PipelineType ,
250250 (
0 commit comments