Spaces:
Runtime error
Runtime error
➕ Update README.md to Include endpoints Variable (#288)
Browse files* Update README.md
Added endpoints variable information to default model conf in readme
* Update .env
Added endpoints variable and commented out
* Update .env
Removed .env change - Moving information to readme per feedback
* Update README.md
Updated the readme to include custom endpoint parameters.
endpoints url, authorization & weight are now defined
* Update README.md
Adjusted endpoints information to refer to adding parameters instead of adjusting parameters as they do not exist in the default .env being provided.
* Update README.md
Formatting
README.md
CHANGED
@@ -115,9 +115,52 @@ MODELS=`[
|
|
115 |
|
116 |
You can change things like the parameters, or customize the preprompt to better suit your needs. You can also add more models by adding more objects to the array, with different preprompts for example.
|
117 |
|
118 |
-
### Running your own models
|
119 |
|
120 |
-
If you want to, you can even run your own models, by having a look at our endpoint project, [text-generation-inference](https://github.com/huggingface/text-generation-inference). You can then add your own endpoint to the `MODELS` variable in `.env.local
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
## Deploying to a HF Space
|
123 |
|
|
|
115 |
|
116 |
You can change things like the parameters, or customize the preprompt to better suit your needs. You can also add more models by adding more objects to the array, with different preprompts for example.
|
117 |
|
118 |
+
### Running your own models using a custom endpoint
|
119 |
|
120 |
+
If you want to, you can even run your own models, by having a look at our endpoint project, [text-generation-inference](https://github.com/huggingface/text-generation-inference). You can then add your own endpoint to the `MODELS` variable in `.env.local`. Using the default `.env` information provided above as an example, the endpoint information is added after `websiteUrl` and before `userMessageToken` parameters.
|
121 |
+
|
122 |
+
```
|
123 |
+
"websiteUrl": "https://open-assistant.io",
|
124 |
+
"endpoints": [{"url": "https://HOST:PORT/generate_stream"}],
|
125 |
+
"userMessageToken": "<|prompter|>",
|
126 |
+
```
|
127 |
+
|
128 |
+
### Custom endpoint authorization
|
129 |
+
|
130 |
+
Custom endpoints may require authorization. In those situations, we will need to generate a base64 encoding of the username and password.
|
131 |
+
|
132 |
+
`echo -n "USER:PASS" | base64`
|
133 |
+
|
134 |
+
> VVNFUjpQQVNT
|
135 |
+
|
136 |
+
You can then add the generated information and the `authorization` parameter to your `.env.local`.
|
137 |
+
|
138 |
+
```
|
139 |
+
"endpoints": [
|
140 |
+
{
|
141 |
+
"url": "https://HOST:PORT/generate_stream",
|
142 |
+
"authorization": "Basic VVNFUjpQQVNT",
|
143 |
+
}
|
144 |
+
]
|
145 |
+
```
|
146 |
+
|
147 |
+
### Models hosted on multiple custom endpoints
|
148 |
+
|
149 |
+
If the model being hosted will be available on multiple servers/instances add the `weight` parameter to your `.env.local`.
|
150 |
+
|
151 |
+
```
|
152 |
+
"endpoints": [
|
153 |
+
{
|
154 |
+
"url": "https://HOST:PORT/generate_stream",
|
155 |
+
"weight": 1
|
156 |
+
}
|
157 |
+
{
|
158 |
+
"url": "https://HOST:PORT/generate_stream",
|
159 |
+
"weight": 2
|
160 |
+
}
|
161 |
+
...
|
162 |
+
]
|
163 |
+
```
|
164 |
|
165 |
## Deploying to a HF Space
|
166 |
|