sim04ful commited on
Commit
d02242a
1 Parent(s): 7427e59

removed yield

Browse files
Files changed (2) hide show
  1. abl_schema.json +37 -0
  2. handler.py +1 -2
abl_schema.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "Art QR Code Generator",
3
+ "description": "Generate Artistic QR Codes With AI",
4
+ "endpoint": "https://mq64ryl6i60phx3z.us-east-1.aws.endpoints.huggingface.cloud",
5
+ "fields": [
6
+ {
7
+ "name": "inputs",
8
+ "type": "_",
9
+ "value": []
10
+ },
11
+ {
12
+ "name": "styles",
13
+ "type": "Text",
14
+ "description": "Write a prompt describing the appearance of your artistic QR Code",
15
+ "area": true,
16
+ "title": "Style"
17
+ },
18
+ {
19
+ "name": "content",
20
+ "type": "Text",
21
+ "description": "Content of the QR code",
22
+ "area": false,
23
+ "min": 1,
24
+ "max": 200,
25
+ "title": "Content"
26
+ },
27
+ {
28
+ "name": "art_scale",
29
+ "type": "Number",
30
+ "description": "This controls how much creativity is used in the QR code",
31
+ "title": "Creativity",
32
+ "min": 0,
33
+ "max": 1,
34
+ "slider_step": 0.1
35
+ }
36
+ ]
37
+ }
handler.py CHANGED
@@ -10,7 +10,7 @@ import qrcode
10
  import os
11
  import base64
12
  from io import BytesIO
13
-
14
  from PIL import Image
15
 
16
  MODEL_ID = "simdi/colorful_qr"
@@ -176,5 +176,4 @@ class EndpointHandler:
176
 
177
  def __call__(self, model_input: Dict[str, Any]):
178
  images = generate_image(self._model, model_input)
179
- yield {"fields": [{"name": "progress", "type": "Progress"}]}
180
  return images
 
10
  import os
11
  import base64
12
  from io import BytesIO
13
+ import json
14
  from PIL import Image
15
 
16
  MODEL_ID = "simdi/colorful_qr"
 
176
 
177
  def __call__(self, model_input: Dict[str, Any]):
178
  images = generate_image(self._model, model_input)
 
179
  return images