Spaces:
Runtime error
Runtime error
thesourmango commited on
Commit ·
a79d5b7
1
Parent(s): 09860e5
Added JS deployment guide
Browse files
README.md
CHANGED
|
@@ -15,7 +15,7 @@ The Mistral GUI is located on https://huggingface.co/spaces/bistromd/Mistral
|
|
| 15 |
|
| 16 |
The API endpoint is on https://bistromd-mistral--t49mg.hf.space/
|
| 17 |
|
| 18 |
-
### Requirements for deployment
|
| 19 |
I use the gradio_client Python library or the @gradio/client Javascript package to query the demo via API.
|
| 20 |
|
| 21 |
```
|
|
@@ -42,7 +42,30 @@ print(result)
|
|
| 42 |
|
| 43 |
## Return Type(s)
|
| 44 |
str representing output in 'Message' Textbox component
|
|
|
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
The API endpoint is on https://bistromd-mistral--t49mg.hf.space/
|
| 17 |
|
| 18 |
+
### Requirements for deployment using Python
|
| 19 |
I use the gradio_client Python library or the @gradio/client Javascript package to query the demo via API.
|
| 20 |
|
| 21 |
```
|
|
|
|
| 42 |
|
| 43 |
## Return Type(s)
|
| 44 |
str representing output in 'Message' Textbox component
|
| 45 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 46 |
|
| 47 |
+
## Requirements for deployment using JS
|
| 48 |
+
```
|
| 49 |
+
$ npm i -D @gradio/client
|
| 50 |
+
```
|
| 51 |
|
| 52 |
+
### Named Endpoints
|
| 53 |
+
api_name: /chat
|
| 54 |
|
| 55 |
+
```
|
| 56 |
+
import { client } from "@gradio/client";
|
| 57 |
+
|
| 58 |
+
const app = await client("https://bistromd-mistral--zr2ft.hf.space/");
|
| 59 |
+
const result = await app.predict("/chat", [
|
| 60 |
+
"Howdy!", // string in 'Message' Textbox component
|
| 61 |
+
0, // number (numeric value between 0.0 and 1.0) in 'Temperature' Slider component
|
| 62 |
+
0, // number (numeric value between 0 and 1048) in 'Max new tokens' Slider component
|
| 63 |
+
0, // number (numeric value between 0.0 and 1) in 'Top-p (nucleus sampling)' Slider component
|
| 64 |
+
1, // number (numeric value between 1.0 and 2.0) in 'Repetition penalty' Slider component
|
| 65 |
+
]);
|
| 66 |
+
|
| 67 |
+
console.log(result.data);
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
### Return Type(s)
|
| 71 |
+
string representing output in 'Message' Textbox component
|