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

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +17 -16
main.py CHANGED
@@ -35,25 +35,26 @@ def generate_image(prompt, inference_steps, model):
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
 
58
  return {"response": filename}
59
 
 
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