sourceoftruthdata commited on
Commit
4615aaf
1 Parent(s): b6a5569

Update README.md

Browse files

add usage information

Files changed (1) hide show
  1. README.md +18 -0
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
+