File size: 2,177 Bytes
ec8c38a
 
 
 
 
 
 
 
 
 
 
 
1f9b19e
 
 
 
 
a79d5b7
1f9b19e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a79d5b7
1f9b19e
a79d5b7
 
 
 
1f9b19e
a79d5b7
 
1f9b19e
a79d5b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
title: MistralAPI
emoji: 📉
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 3.47.1
app_file: app.py
pinned: false
license: apache-2.0
---

## This is the API endpoint implementation of the Mistral interface
The Mistral GUI is located on https://huggingface.co/spaces/bistromd/Mistral

The API endpoint is on https://bistromd-mistral--t49mg.hf.space/

### Requirements for deployment using Python
I use the gradio_client Python library or the @gradio/client Javascript package to query the demo via API.

```
$ pip install gradio_client
```

### Named Endpoints
*api_name: /chat*

```
from gradio_client import Client

client = Client("https://bistromd-mistral--t49mg.hf.space/")
result = client.predict(
		"Howdy!",	# str  in 'Message' Textbox component
		0,	# int | float (numeric value between 0.0 and 1.0) in 'Temperature' Slider component
		0,	# int | float (numeric value between 0 and 1048) in 'Max new tokens' Slider component
		0,	# int | float (numeric value between 0.0 and 1) in 'Top-p (nucleus sampling)' Slider component
		1,	# int | float (numeric value between 1.0 and 2.0) in 'Repetition penalty' Slider component
		api_name="/chat"
)
print(result)
```

## Return Type(s)
str representing output in 'Message' Textbox component
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

## Requirements for deployment using JS
```
$ npm i -D @gradio/client
```

### Named Endpoints
api_name: /chat

```
import { client } from "@gradio/client";

const app = await client("https://bistromd-mistral--zr2ft.hf.space/");
const result = await app.predict("/chat", [		
				"Howdy!", // string  in 'Message' Textbox component		
				0, // number (numeric value between 0.0 and 1.0) in 'Temperature' Slider component		
				0, // number (numeric value between 0 and 1048) in 'Max new tokens' Slider component		
				0, // number (numeric value between 0.0 and 1) in 'Top-p (nucleus sampling)' Slider component		
				1, // number (numeric value between 1.0 and 2.0) in 'Repetition penalty' Slider component
	]);

console.log(result.data);
```

### Return Type(s)
string representing output in 'Message' Textbox component