Update README.md
#1
by
sourceoftruthdata
- opened
README.md
CHANGED
@@ -15,3 +15,21 @@ Text encoder was not trained.
|
|
15 |
This is the model that feeds the Google Colab Notebook.
|
16 |
The model is a simplified version of the DreamBooth model.
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
This is the model that feeds the Google Colab Notebook.
|
16 |
The model is a simplified version of the DreamBooth model.
|
17 |
|
18 |
+
Here is how to use the model:
|
19 |
+
|
20 |
+
import requests
|
21 |
+
|
22 |
+
API_URL = "https://api-inference.huggingface.co/models/sourceoftruthdata/sot_autotrain_dreambooth_v1"
|
23 |
+
headers = {"Authorization": "Bearer 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"}
|
24 |
+
|
25 |
+
def query(payload):
|
26 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
27 |
+
return response.content
|
28 |
+
image_bytes = query({
|
29 |
+
"inputs": "Astronaut riding a horse",
|
30 |
+
})
|
31 |
+
# You can access the image with PIL.Image for example
|
32 |
+
import io
|
33 |
+
from PIL import Image
|
34 |
+
image = Image.open(io.BytesIO(image_bytes))
|
35 |
+
|