File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 132132 " /model-api/docs/task/visual-question-answering"
133133 ]
134134 },
135- " model-api/docs/containers"
135+ " model-api/docs/containers" ,
136+ " model-api/docs/requestAModel"
136137 ]
137138 }
138139 ]
Original file line number Diff line number Diff line change 1+ ---
2+ title : ' Request a model'
3+ description : ' How to request a model'
4+ icon : ' send'
5+ mode : ' wide'
6+ ---
7+
8+ Bytez is able to automatically process any model on Huggingface. To request a model, you must hit our endpoint at:
9+
10+ ` https://api.bytez.com/models/v2/request/{modelId} `
11+
12+ ## Request a model
13+
14+ Example model ID:
15+
16+ ` Finisha-F-scratch/Lamina-basic `
17+
18+ Endpoint used in the examples below:
19+
20+ ` https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic `
21+
22+ <CodeGroup >
23+
24+ ``` javascript title="JavaScript"
25+ const url = ' https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic' ;
26+
27+ fetch (url, {
28+ method: ' POST' ,
29+ })
30+ .then ((response ) => response .json ())
31+ .then ((data ) => {
32+ console .log (' Response:' , data);
33+ })
34+ .catch ((error ) => {
35+ console .error (' Error:' , error);
36+ });
37+ ```
38+
39+ ``` python title="Python"
40+ import requests
41+
42+ url = " https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic"
43+
44+ response = requests.post(url)
45+
46+ print (" Status Code:" , response.status_code)
47+ print (" Response JSON:" , response.json())
48+ ```
49+
50+ ``` bash title="curl"
51+ curl -X POST \
52+ https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic
53+ ```
54+
55+ </CodeGroup >
56+
57+ ### Expected Response
58+
59+ ``` json
60+ {
61+ "error" : null ,
62+ "output" : " Job queued"
63+ }
64+ ```
You can’t perform that action at this time.
0 commit comments