jclyo1 commited on
Commit
f4154bf
1 Parent(s): c13c176

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +18 -18
main.py CHANGED
@@ -34,27 +34,27 @@ def generate_image(prompt, inference_steps, model):
34
 
35
  print(filename)
36
 
37
- # Data to be written
38
- # assertion = {
39
- # "assertions": [
40
- # {
41
- # "label": "com.truepic.custom.ai",
42
- # "data": {
43
- # "model_name": model,
44
- # "model_version": "1.0",
45
- # "prompt": prompt
46
- # }
47
- # }
48
- # ]
49
- # }
50
 
51
- # json_object = json.dumps(assertion, indent=4)
52
- # with open("assertion.json", "w") as outfile:
53
- # outfile.write(json_object)
54
 
55
  subprocess.check_output(['./truepic-sign', 'init', 'file-system', '--api-key', os.environ.get("api_key")])
56
- # subprocess.check_output(['./truepic-sign', 'sign', filename, '--assertions', 'assertion.json', '--output', (os.getcwd() + '/static/' + filename)])
57
- subprocess.check_output(['./truepic-sign', 'sign', filename, '--output', (os.getcwd() + '/static/' + filename)])
58
 
59
  return {"response": filename}
60
 
 
34
 
35
  print(filename)
36
 
37
+ Data to be written
38
+ assertion = {
39
+ "assertions": [
40
+ {
41
+ "label": "com.truepic.custom.ai",
42
+ "data": {
43
+ "model_name": model,
44
+ "model_version": "1.0",
45
+ "prompt": prompt
46
+ }
47
+ }
48
+ ]
49
+ }
50
 
51
+ json_object = json.dumps(assertion, indent=4)
52
+ with open("assertion.json", "w") as outfile:
53
+ outfile.write(json_object)
54
 
55
  subprocess.check_output(['./truepic-sign', 'init', 'file-system', '--api-key', os.environ.get("api_key")])
56
+ subprocess.check_output(['./truepic-sign', 'sign', filename, '--assertions', 'assertion.json', '--output', (os.getcwd() + '/static/' + filename)])
57
+ # subprocess.check_output(['./truepic-sign', 'sign', filename, '--output', (os.getcwd() + '/static/' + filename)])
58
 
59
  return {"response": filename}
60